apache2 - How do I access an Apache web server using a domian name instead of IP? - Ask Ubuntu


i runnning apache server , want access site typing something.somethingelse.gr instead of 192.168.1.105 .

how can that?

go /etc/apache2/sites-available folder , copy default 00-default.conf file mysite.conf. can use unique name mysite.conf. in case call something-somethingelse-gr.conf (for own personal identifying designation virtual site.

then edit new configuration. uncomment servername directive , replace www.example.com something.somethingelse.gr. can add other names call same server using serveralias directive described below.

change from:

 # servername directive sets request scheme, hostname , port # server uses identify itself. used when creating # redirection urls. in context of virtual hosts, servername # specifies hostname must appear in request's host: header # match virtual host. default virtual host (this file) # value not decisive used last resort host regardless. # however, must set further virtual host explicitly. #servername www.example.com      serveradmin webmaster@localhost     documentroot /var/www/html 

change to:

 # servername directive sets request scheme, hostname , port # server uses identify itself. used when creating # redirection urls. in context of virtual hosts, servername # specifies hostname must appear in request's host: header # match virtual host. default virtual host (this file) # value not decisive used last resort host regardless. # however, must set further virtual host explicitly.      servername something.somethingelse.gr     serveralias www.something.somethingelse.gr      serveradmin webmaster@localhost     documentroot /var/www/html 

then run commandline:

$ a2ensite mysite.conf 

Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User