Solved

How to create a web site hosted in centOS server?

Posted on 2014-01-12
11
547 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
11 Comments
 
LVL 108

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
 
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 82

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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to count occurrences of each item in an array.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now