• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 579
  • Last Modified:

How to create a web site hosted in centOS server?

I was given a task to create a web server using centOS server. The centOS version is 5.5. I will be setting up this server soon and turn this server as web server. Do I have to install apache or other web server? This website was previously hosted by a web provider, and my boss decided to terminate the hosting, so, a backup of the web site was copied. I can see the in the parent folder of the web, there is a htdocs folder, and a sql db. Within the htdocs folder, I can see administrator, cache, components, images, includes, languagues, plus other folders and PHP files. How should I start to host these web into my centOS server?

thanks,
0
MichaelBalack
Asked:
MichaelBalack
1 Solution
 
Ray PaseurCommented:
Michael, this is not an answer to the question so much as some guidance from "the trenches."  I don't know how much you were paying for hosting services, but in the US the cost is literally pennies per day.  In exchange for that you get:

1. An expert staff that monitors security
2. Administrators who keep your site software up to date
3. A secure facility, where nobody can steal your data (or steal your server)
4. An uninterruptible power supply
5. Adequate cooling (75% of the cost of hosting is KvA and BTU)
6. Backups

You're going to have to start doing all of these things yourself if you cancel your hosting contract.  Are you sure that's a good business decision?  Do you have the specialized skills, tools and knowledge that would equip you to do a professional job as a server administrator and security expert?  Do you want to be on call 24/7 for any and every eventuality that can occur on the server?

I sincerely hope you and your boss can agree to rethink this in light of the enormous risks and hidden costs that you will suffer if you go down this path.  If you want some recommendations of quality hosting companies, I'll be glad to share my experiences.
0
 
Conner TurnerCommented:
Hello There,

Firstly, Yes you will need to install a Web Server this is easy form a CLI (Command Line Interface) of a Server.

I would recommend apache2 for a web-server as it is easy to configure, this can either be installed in with LAMP or as a single module.

However the first thing to do with a server is to execute and update:
$ yum update

Open in new window


To install apache2 please execute one of the following:
$ yum install apache2

Open in new window

-This will install the single module
$ yum install lamp-server

Open in new window

-This will install the LAMP package which includes PHP 5 and MySQL

Once the installation has been completed you will need to upload the backup of the website to your server and move it to
/var/www/

Open in new window

this will ensure it is being read by Apache2

This can be achieved by using the
mv

Open in new window

command:
$ mv {backup-file} /var/www/

Open in new window

- Replace {backup-file} with the location of your backup directory.

I hope this clears a few things up for you and Good Luck !
0
 
MichaelBalackAuthor Commented:
Hi Conner Turner,

Thanks for everything. Please allow me to go through all your steps before getting back to you.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Conner TurnerCommented:
No Problem, Let me know if you are having any trouble and i will gladly assist you in any way I can :)
0
 
Dave BaldwinFixer of ProblemsCommented:
I agree with Ray on this.  While I have web servers on more than 10 computers here, I would Never try to put them 'live' on the internet.  I would never have time to maintain security on them much less do any development.  I have 3 hosting accounts and a dozen domains with professional hosting companies.  I do prototyping and design on my local computer but up load the file to my real hosting when I go 'live' with them.
0
 
MichaelBalackAuthor Commented:
Hi Connner Turner,

How about the *.sql db file? How should I import it into the MySQL? Does it require admin account and password?
0
 
Conner TurnerCommented:
Hello,

Importing an SQl file is easy with a CLI ,

If you have installed the LAMP server then you can ignore
steps 1 and 2:

1) Install MySQL server with:
$ apt-get install mysql-server

Open in new window

2) Go through the CLI Setup for the SQL server
3) Import the file onto the server
4) create a database within the MySQL
$ mysql -u root -e "create database {dbname}"

Open in new window

- Replace {dbname} with a desired name for the db
5) import the SQL file with:
$ mysql -u root {dbname} < {sql-filename}

Open in new window

- Replace the dbname with your dbname set before and sql-filename
with the SQL file you can use tab to auto complete.

HTH,

Conner.
0
 
MichaelBalackAuthor Commented:
Thanks Conner, I will start the setup on Thursday. I will update you about the status or request for help.
0
 
MichaelBalackAuthor Commented:
Hi Conner,

I've put all the pages into /var/www/, as well as the DB in MySQL. Main page can be browsed without problem. However, I can't seem to browse the subsequent pages. For example, there are few options present on the main page, and clicking any of them led to a error "missing page". I heard that I might need to change some setting for "htaccess". Any idea?
0
 
Conner TurnerCommented:
Hello,

Could you post a directory listing if possible so I can see how the pages are setup?

Please only do this is it is safe to do so.

The .htaccess controls some configurations of Apache this may be a cause if the pages are being either redirected by the htaccess.

HTH,
Conner.
0
 
MichaelBalackAuthor Commented:
After granting the permissions on the .htaccess, web site is working fine
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now