Apache works on localhost but not on server name -
Apache works on localhost but not on server name -
as user id suggests, novice programmer.
i trying simple apache server configuration in ubuntu,
i have created below .conf file in /etc/apache2/sites-available/awesome.conf below code. have created symbolic link in /etc/apache2/sites-enable , restarted apache.
<virtualhost *:80> # 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 lastly resort host regardless. # however, must set farther virtual host explicitly. servername www.myawesome.org serveradmin webmaster@localhost documentroot /var/www/awesome directoryindex hello.php # available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # possible configure loglevel particular # modules, e.g. #loglevel info ssl:warn errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined # configuration files conf-available/, # enabled or disabled @ global level, possible # include line 1 particular virtual host. illustration # next line enables cgi configuration host # after has been globally disabled "a2disconf". #include conf-available/serve-cgi-bin.conf </virtualhost>
when access localhost/awesome/hello.php desired text "hello world".
but when type www.myawesome.org dispays below message: "server not found"
any help/guidance appreciated.
regards....
you need edit hosts file , add together servername here pointing localhost
open hosts file with:
sudo nano /etc/hosts
...and @ end of file add:
127.0.0.1 www.myawesome.org
apache localhost
Comments
Post a Comment