Re: Quick Apache 2 question

Bart Oleksy
 

Nice, thanks Rob!  


I tried installing a 13.04 Ubuntu but couldn't get it to work properly, then discovered that it's no longer available on the ubuntu.com site.  It jumps from 12.xx to 14.xx!  I guess I missed the memo that 13 was not to be used.


So far my exercise works just fine on 12.04, so that's my immediate work-around, but I'll definitely need to update things for 14.04 or beyond for next time, so this will definitely come in handy.

Thanks to all for the advice!

Bart



From: Robert Goshko <robert.goshko@...>
Sent: Tuesday, March 22, 2016 1:41 PM
To: elug@groups.io
Subject: Re: [elug] Quick Apache 2 question
 
This is a template I use for Apache2 on Ubuntu 14.04.4 LTS (AWS machine):

<VirtualHost *:80>
ServerName domain.com
domain.com
Register a domain name and transfer domains. Reliable web hosting and VPS. Powerful website, blog, and ecommerce tools. 12 years, millions of customers.

ServerAlias www.domain.com
ServerAdmin webmaster@...

# Use this to rewrite URL’s to a if you wish
# RewriteEngine On
# RewriteCond %{HTTP_HOST} ^domain.com [NC]

# Actual path here
DocumentRoot /var/www/domain_directory

# Permission for above “root” directory
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

ServerSignature On

</VirtualHost>

On Mar 21, 2016, at 3:10 PM, Bart Oleksy <BARTO@...> wrote:

And another question about Apache 2..

I used to get a default config file in sites-available called "default", but this time I see a different name of "000-default.conf" that has reasonably different content.  I found online the 'old' content and used that, modified for /var/www/default instead of /var/www or /var/www/html and I still get a listing of folders in /var/www rather than the index.html file I put in /var/www/default.  

So it's a similar problem - Apache isn't taking me into the right folder in /var/www (either default as above or SiteB as below), so I clearly missed something in a config file somewhere.


I haven't touched the original apache2.conf file.

Help!  (please)

Bart


From: Bart Oleksy <BARTO@...>
Sent: Monday, March 21, 2016 3:01 PM
To: elug@groups.io
Subject: [elug] Quick Apache 2 question
 
Last time I tried this exercise it worked, but I guess that was 2 years ago... 

I created a directory /var/www/SiteB and put a simple index.html file in it.  Permissions are 755.

Then in sites-available I have a configuration file (linked to ../sites-enabled) like this:

<VirtualHost dmit1523.siteb>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/SiteB
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/SiteB>
Options -Indexes FollowSymLinks MultiViews
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>
</VirtualHost>

I've got an entry in /etc/hosts using my local machine's IP and the name 'dmit1523.siteb', and pinging by name works.

I've restarted Apache with both 
service apache2 reload
and
apache2ctl restart

But when I try a browser on the local machine with a URL of "http://dmit1523.siteb" I get an index (directory listing) of /var/www instead of seeing my index.html file displayed.

Likely something very simple here - any suggestions?

This is on Ubuntu 14.04 (desktop).

Thanks!

Bart


Join elug@groups.io to automatically receive all group messages.