logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Having some issues with virtual hosting
Author
ImageJPEG



Joined: 29 Jan 2015
Posts: 3
Location: United States of America, Arthur

PostPosted: Thu 05 Feb '15 20:13    Post subject: Having some issues with virtual hosting Reply with quote

I'm currently hosting two domains on one server with one IP address. Everything runs almost perfectly.

Here's my issue. I don't want certian subdirectories listed with both sites.

Here's what I'm talking about.

I don't want http://notafqdn.com/mail to show up as http://ajstv.net/mail

That's really my own main issue that I can't seem to solve.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 06 Feb '15 4:26    Post subject: Reply with quote

Is the DocumentRoot on both hosts point to the same place?
Is /mail done via an Alias?
Back to top
ImageJPEG



Joined: 29 Jan 2015
Posts: 3
Location: United States of America, Arthur

PostPosted: Fri 06 Feb '15 7:05    Post subject: Reply with quote

This is the virtual host section out of my httpd.conf file.

Code:
Listen 192.168.1.32:80
Listen 192.168.1.32:443
<VirtualHost 192.168.1.32:443>
        ServerName notafqdn.com
        DocumentRoot /usr/local/www/notafqdn.com
        <Directory />
                Require all granted
                Allowoverride ALL
        </Directory>
        # Compressed Pages
        <Directory "/usr/local/www/notafqdn.com">
                AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
        </Directory>

        <Directory "/usr/local/www/roundcube">
                AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
        </Directory>

        <Directory "/usr/local/www/phpMyAdmin">
                AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
        </Directory>
        SSLEngine on
        SSLCertificateFile /usr/local/etc/ssl/certs/notafqdn.com.crt
        SSLCertificateKeyFile /usr/local/etc/ssl/private/notafqdn.com.key
        Header set Strict-Transport-Security "max-age=31536000"
</VirtualHost>
<VirtualHost 192.168.1.32:443>
        ServerName ajstv.net
        DocumentRoot /usr/local/www/ajstv.net
        <Directory />
                Require all granted
                Allowoverride ALL
        </Directory>
        # Compressed Pages
       <Directory "/usr/local/www/ajstv.net">
                AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
        </Directory>
        SSLEngine on
        SSLCertificateFile /usr/local/etc/ssl/certs/ajstv.net.crt
        SSLCertificateKeyFile /usr/local/etc/ssl/private/ajstv.net.key
        Header set Strict-Transport-Security "max-age=31536000"
</VirtualHost>
<VirtualHost 192.168.1.32:80>
        ServerName notafqdn.com
        DocumentRoot /usr/local/www/notafqdn.com
        <Directory />
                Require all granted
                Allowoverride ALL
        </Directory>
        # Compressed Pages
        <Directory "/usr/local/www/notafqdn.com">
                AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
        </Directory>

        <Directory "/usr/local/www/roundcube">
                AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
        </Directory>

        <Directory "/usr/local/www/phpMyAdmin">
                AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
        </Directory>
        #Force Encryption On Sub-Directories
        RewriteEngine On
        RewriteCond %{HTTPS} !=on
        RewriteRule ^/?wp-admin/(.*) https://%{SERVER_NAME}/wp-admin/$1 [R,L]
        RewriteRule ^/?mail/(.*) https://%{SERVER_NAME}/mail/$1 [R,L]
        RewriteRule ^/?phpmyadmin/(.*) https://%{SERVER_NAME}/phpmyadmin/$1 [R,L]
</VirtualHost>
<VirtualHost 192.168.1.32:80>
        ServerName ajstv.net
        DocumentRoot /usr/local/www/ajstv.net
        <Directory />
                Require all granted
                Allowoverride ALL
        </Directory>
         # Compressed Pages
        <Directory "/usr/local/www/ajstv.net">
                AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
        </Directory>
        #Force Encryption On Sub-Directories
         RewriteEngine On
         RewriteCond %{HTTPS} !=on
         RewriteRule ^/?wp-admin/(.*) https://%{SERVER_NAME}/wp-admin/$1 [R,L]
</VirtualHost>
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 06 Feb '15 9:05    Post subject: Reply with quote

You must somewhere have an Alias for /mail

Alias /mail /usr/local/www/roundcube

And it must certainly be in the global context since I do not see it shown in either vhost. Move this Alias inside your vhosts for notafqdn.com so it's no longer Global. Being it's roundcube and it requires login, I personally would only move it into the https vhost for notafqdn.

EDIT:
Since I've now read "What's it running?" at notafqdn I'm removing my harassment about

<Directory />
Require all granted
Allowoverride ALL
</Directory>

But I really want to discourage other from ever doing this.
Back to top
ImageJPEG



Joined: 29 Jan 2015
Posts: 3
Location: United States of America, Arthur

PostPosted: Sat 07 Feb '15 0:52    Post subject: Reply with quote

I feel REALLY stupid. I forgot to remove the config files from the Includes folder. Dur.

Thanks for the replies though.
Back to top


Reply to topic   Topic: Having some issues with virtual hosting View previous topic :: View next topic
Post new topic   Forum Index -> Apache