IP Address Setup
- Started
- Last post
- 8 Responses
- ukit
Does anyone know how to set up IP addresses on Linux (Debian)? I've added some domains on my server and can get the domain URL to resolve to the right place but the IP remains pointed at the default file in the var/www/ folder. How do I get it to point to the same folder as the domain name?
- moth0
http://www.debian-administration…
Something like that.
- armsbottomer0
are you working with vhost files?
if so, you can just redirect where the home directory is. usually located in /etc/apache2/sites-available, then just enable them so that they are in sites-available
- ukit0
How do I know if it's vhost or not?
- armsbottomer0
check your sites-enabled folder folder if there are any entries already there, you can do:
$ cd etc/apache2/sites-enabled
$ lsif there aren't any there to reference, you can create one. they usually look like:
<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin
ServerName domain.com
ServerAlias www.domain.com# Index file and Document Root (where the public files are located)
DirectoryIndex index.html
DocumentRoot /dir/to/your/website# Custom log file locations
LogLevel warn
ErrorLog dir/to/log/error.log
CustomLog dir/to/log/access.log combined</VirtualHost>
- sorry, you should be looking in
cd etc/apache2/sites-av...armsbottomer - *sites-availablearmsbottomer
- sorry, you should be looking in
- armsbottomer0
to enable the site so that it's live (at least in ubunto) you'd do:
$ sudo a2ensite name_of_vhost_file
within the sites-available folder. then it will be linked to the sites-enabled folder, where all of your active domains are. then you reload apache and it should be live, assuming you already have the dns setup correctly for that domain
- armsbottomer0
basically, the virtual hosts files allow you to use multiple domains on the same ip. you can also say where the domain root is stored on your server within the vhost file (i.e. the DocumentRoot declaration)
- armsbottomer0
i think you also need to make sure that you have added the following line to the bottom your apache.conf file (located in /etc/apache2/)
Include /etc/apache2/sites-enabled/
- ukit0
Awesome thanks! Worked like a charm