Originally Posted by
venkatraghavang
Hi,
I have 10 systems working on LAN with fixed IP given to all the 10. I have ubuntu installed. "ifconfig" shows my IP on eth0 interface.
Query : I've my blog at /var/www with Apache installed and it works fine when i give the IP address of eth0 (Not 127.0.0.1). And it works from any system when i give the IP address.
* How can i change the IP address to a simple URL. Eg: Instead of
http://173.xxx.xxx.xxx to
http://mysite
I've tried:
1) Adding entry to hosts & configuring httpd.conf in apache. Did not work.
2) I don't want any bind, as it should be accesible only within the LAN.
Experts of Ubuntu Forums, here goes your question..
/etc/hosts
Code:
# IPaddress HostName Alias
127.0.1.1 www.mysite.whatever
/etc/resolv.conf
You'll also need to have apache setup for www.mysite.whatever
In /etc/apache2 you've got two sub dir.'s, sites-available and sites-enabled. For my page I've got the following file for my no-ip.com site in /etc/apache2/sites-available/www.mysite.whatever
Code:
<VirtualHost *:45826> # 45826 is my port that no-ip will redirect to, you'll use port 80 for http.
ServerName www.mysite.whatever
ServerAdmin barrie@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
In /etc/apache2/sites-enabled you then have a symlink of the above file except ending with .conf You can use a2ensite to enable a site in /etc/apache2/sites-available and a2dissite to disable sites. Once I get going on the keyboard I create the links myself.
Bookmarks