Jump to content

How do I set up IP addresses for different folders on server?


sisom

Recommended Posts

Hi, I have an Apache server with Fasthosts, and I already have three sites set up on it (I didn't set them up), but I am slowly learning how to do things, and have set up two new sites in a sub folder of one of the main sites. I now realise I need an SSL certificate, and that these two new sites will have to have their own /home/site folder, i.e. the other three sites are under

/home/site1/public_html

/home/site2/public_html

/home/site3/public_html

 

and currently the two new sites are under

/home/site1/public_html/newsite1

/home/site1/public_html/newsite2

 

When the first three sites were set up for me, they were assigned IP addresses. I've asked the company who did it for me if they could tell me how they did it, as I'm sure it's just a matter of editing a config file somewhere, but they said they would give me a quote for them doing it, which I don't want.

Can anybody tell me which config file I need to edit, or point me in the direction of an online guide for this?

 

I'm sorry if this question has already been answered somewhere on these forums, I did try searching for it, but 'IP address' brought up a load of questions about blocking/limiting/etc. users' IP addresses, which isn't what I'm trying to do.

 

Many thanks in advance for you help guys (and gals!).

Link to comment
Share on other sites

Unfortunately I still can't get it to work.

 

Here's what my server's folders look like:

 

etc/httpd/conf

etc/httpd/conf.d

etc/httpd/sites

 

etc/httpd/conf/httpd.conf  looks like this, lines 207 - 210:

 

#

# Load config files from the config directory "/etc/httpd/conf.d".

#

Include conf.d/*.conf

 

I already have three sites set up (by an installation company), and this is what they have in the

etc/httpd/conf.d

folder, files called

www.mydomain.com.conf

 

which are like this (IP address redacted):

 

<VirtualHost XX.XXX.XXX.XX:80>

Include sites/www.mydomain.com.conf

</VirtualHost>

 

<VirtualHost XX.XXX.XXX.XX:443>

SSLCertificateFile /etc/httpd/ssl/mydomain.com.crt

SSLCACertificateFile /etc/httpd/ssl/mydomain.com.ca

SSLCertificateKeyFile /etc/httpd/ssl/mydomain.com.key

Include sites/ssl-common.conf

Include sites/www.mydomain.com.conf

</VirtualHost>

 

so I looked in

etc/httpd/sites

and www.mydomain.com.conf is also in there, but this time it looks like this:

 

ServerName www.mydomain.com

ServerAlias mydomain.com

 

DocumentRoot /home/mydomain/public_html

<Directory /home/mydomain/public_html>

Allow From All

AllowOverride All

</Directory>

 

 

I've created a /home/mynewdomain

and

/home/mynewdomain/public_html

folder, and put my site into it. I've set the permissions of all the folders and all the files to the same as those of the three sites that are already running. I've copied the two .conf files above and inserted the correct IP address (I have bought a new IP address to add to the three that are already set up for the server), and changed the 'mydomain' part to the real domain name. But when I go to the IP address in my browser, it won't load, and I eventually get a message: "The server at XX.XXX.XXX.XX is taking too long to respond."

 

Is there anywhere else that I have missed, which I should edit? I thought I had covered everything, but it's just not working. (I'm not using the domain name in my browser yet, because the site is actually up at the moment, but in a subfolder of one of the three websites that are already running on the server, and using an .htaccess file to redirect to it. I'm going to install an SSL certificate tomorrow (yeah right!) so I have to have an IP address for the domain name).

 

Many thanks in advance if anyone can help me, I'm sure there is something very simple that I've missed. I did read the Apache guide, here:

http://httpd.apache.org/docs/2.0/vhosts/ip-based.html

but it didn't help me.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.