?
Solved

How to create a web site hosted in centOS server?

Posted on 2014-01-12
11
Medium Priority
?
566 Views
Last Modified: 2014-02-11
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
Comment
Question by:MichaelBalack
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39774992
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
 
LVL 3

Expert Comment

by:Conner Turner
ID: 39775004
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
 
LVL 1

Author Comment

by:MichaelBalack
ID: 39775018
Hi Conner Turner,

Thanks for everything. Please allow me to go through all your steps before getting back to you.
0
Supports up to 4K resolution!

The VS192 2-Port 4K DisplayPort Splitter is perfect for anyone who needs to send one source of DisplayPort high definition video to two or four DisplayPort displays. The VS192 can split and also expand DisplayPort audio/video signal on two or four DisplayPort monitors.

 
LVL 3

Expert Comment

by:Conner Turner
ID: 39775026
No Problem, Let me know if you are having any trouble and i will gladly assist you in any way I can :)
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39775185
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
 
LVL 1

Author Comment

by:MichaelBalack
ID: 39775773
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
 
LVL 3

Expert Comment

by:Conner Turner
ID: 39775846
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
 
LVL 1

Author Comment

by:MichaelBalack
ID: 39778494
Thanks Conner, I will start the setup on Thursday. I will update you about the status or request for help.
0
 
LVL 1

Author Comment

by:MichaelBalack
ID: 39798926
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
 
LVL 3

Accepted Solution

by:
Conner Turner earned 2000 total points
ID: 39801526
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
 
LVL 1

Author Closing Comment

by:MichaelBalack
ID: 39849530
After granting the permissions on the .htaccess, web site is working fine
0

Featured Post

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question