Noob: Where to put virtual host entry

POSTSCRIPT: Stoopid me. It's the * that gets replaced in and NameVirtualHost * gets deleted – right? gawd. how embarrassing


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 entry reads: File excerpt: /etc/apache2/sites-available/default

If there is a entry in the default site's configuration file, remove it.

WHAT I DID: I'm stuck. I don't understand "modify in the same file." In the same file? ports.conf???

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 on my websites.

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

ServerAdmin webmaster@your-domain.com ServerName your-domain.com ServerAlias www.your-domain.com DocumentRoot /srv/www/your-domain.com/httpdocs/ ErrorLog /srv/www/your-domain.com/logs/error.log CustomLog /srv/www/your-domain.com/logs/access.log combined

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

````

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct