Noob: Where to put virtual host entry
Setting up LAMP on Ubuntu 8. Hit a little speed bump. Need to know where to put IP in the sites available default file. Maybe I am just tired/brain getting mushy. THANKS for any help!!
Here's where I am in Linode instructions
INSTRUCTIONS: File excerpt: /etc/apache2/ports.conf. NameVirtualHost 12.34.56.78:80. Be sure to replace "12.34.56.78" with your Linode's public IP address.
WHAT I DID: Used remote file edit in FileZilla/ added entry at end of file.
QUESTION: Assume that's correct? Or does it get placed elsewhere in file?
–--------
2.
INSTRUCTIONS: Now, modify the default site's virtual hosting in the same file so that the
WHAT I DID: I'm stuck. I don't understand "modify
I figured it was just a grammatical mispeak, so I went to /sites-available/default and opened in my text editor.
But where in that file so I add:
Here's what the file looks like. I don't see any hash marks indicating something to fill in and no clue where to insert the entry.
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</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>
1 Reply
@nw-woman:
POSTSCRIPT: Stoopid me. It's the * that gets replaced in
and NameVirtualHost * gets deleted – right? gawd. how embarrassing
…
Yes, that's right. Specific addresses in both places is better than a global asterisk.
Also, I use address:80 and address:443 since I have SSL running
So on Ubuntu 10.04 edit /etc/apache2/ports.conf and add a````
NameVirtualHost xxx.xxx.xxx.xxx:80
and edit /etc/apache2/sites-available/your-domain.com
And duplicate those entries for port 443 with the extra bit added to the VirtualHost:
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
````