Create Apache Virtual Host: Step-by-Step Guide

AI Thread Summary
To create a virtual host on an Apache server, modifications were made to the /etc/apache2/sites-enabled/000-default file. The initial configuration was adjusted to define a new virtual host with the IP address 192.168.0.80 and the server name phpweb20, setting the document root to /var/www/phpweb20/htdocs. The directory settings were updated to allow all options and overrides. After restarting Apache, warnings indicated that the server's fully qualified domain name could not be determined, defaulting to 127.0.1.1, and that the server name had not been registered in DNS or the /etc/hosts file. This suggests that additional configuration is needed to resolve the server name correctly.
sean1234
Messages
40
Reaction score
0
I am attempting to create a virtual host here on my machine. I assume the place to do this is in the /etc/apache2/sites-enabled/000-default file. The file currently reads this:

NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@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
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</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>



This is the information I am want to put in the host:

<VirtualHost 192.168.0.80>
ServerName phpweb20
DocumentRoot /var/www/phpweb20/htdocs

<Directory /var/www/phpweb20/htdocs>
AllowOverride All
Options All
</Directory>

php_value include_path .:/var/www/phpweb20/include:/usr/local/lib/pear
php_value magic quotes_gpc off
php_value register_globals off
</virtualHost>





So I changed the file to this:

NameVirtualHost *
<VirtualHost 192.168.0.80>
ServerAdmin webmaster@localhost
ServerName phpweb20

DocumentRoot /var/www/phpweb20/htdocs
<Directory />
Options All
AllowOverride All
</Directory>
<Directory /var/www/phpweb20/htdocs>
Options All
AllowOverride All
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</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>
php_value include_path .:/var/www/phpweb20/include:/usr/local/lib/pear
php_value magic_quotes_gpc off
php_value register_globals off

</VirtualHost>


When I restart apache in the terminal I get this message:

* Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Sun Apr 13 12:26:55 2008] [warn] NameVirtualHost *:0 has no VirtualHosts
httpd (no pid file) not running
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Sun Apr 13 12:27:05 2008] [warn] NameVirtualHost *:0 has no VirtualHosts
 
Computer science news on Phys.org
It seems you haven't registered the servername in your DNS.
 
Nor in the /etc/hosts.
 
I came across a video regarding the use of AI/ML to work through complex datasets to determine complicated protein structures. It is a promising and beneficial use of AI/ML. AlphaFold - The Most Useful Thing AI Has Ever Done https://www.ebi.ac.uk/training/online/courses/alphafold/an-introductory-guide-to-its-strengths-and-limitations/what-is-alphafold/ https://en.wikipedia.org/wiki/AlphaFold https://deepmind.google/about/ Edit/update: The AlphaFold article in Nature John Jumper...
Thread 'Urgent: Physically repair - or bypass - power button on Asus laptop'
Asus Vivobook S14 flip. The power button is wrecked. Unable to turn it on AT ALL. We can get into how and why it got wrecked later, but suffice to say a kitchen knife was involved: These buttons do want to NOT come off, not like other lappies, where they can snap in and out. And they sure don't go back on. So, in the absence of a longer-term solution that might involve a replacement, is there any way I can activate the power button, like with a paperclip or wire or something? It looks...

Similar threads

Replies
6
Views
2K
Back
Top