Re: [Hampshire] Subdomains on a CentOS box

Top Page

Reply to this message
Author: Damian Brasher
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Subdomains on a CentOS box
Richard wrote:

> first post for a very long time.


Nice to see you back:)

> I've never done this before so where do I start?


Make sure you have your httpd service started for the runlevel your server
is logged in at, type at the command prompt;

#runlevel

N 3 or 5

then switch on the service for the reported level:

#chkconfig --level 35 httpd on
#service httpd start

> My httpd.conf file is blank (this was my first port of call) so can I
> just can the subdomain info to that or do I need to configure
> something else.


Is your domain registered by a Domain hosting company? If so you need to
forward the domain to use the external IP address of your server.

Then edit /etc/hosts to make sure the domain is included as your hostname,
e.g.

127.0.0.1           localhost.localdomain localhost
ip.of.server.here   yourdomain.com


You need to be aware of your httpd (apache) configuration. The file is:

/etc/httpd/conf/httpd.conf

Have a look through and search for DocumentRoot for example just to get a
feel for the file. The file is made up of directives.

To start with you shouldn't need to change anything. The folder
/var/www/html is your document root and you need to add index.html or
replace the default with this to start with - then the rest of your site
when you are ready.

The webserver is available, as you probably know, through port 80, so make
sure your firewall allows external access to port 80 if it does not
already.

Point a web browser to the ip or hostname of your new webserver and you
should see a web site displaying the contents of your index.html.

> Like I say, I'm a bit new to web-hosting on a Linux box so please be
> gentle with me.


We'll try:)

Let us know how you go...

Damian