Softaculous


Topic : Apache Virtual Host Configuration - too complex - suggestion


Posted By: keithy on April 7, 2017, 5:25 pm
Quote
UseCanonicalName Off

VirtualDocumentRoot {$path}/www/%0

DirectoryIndex start.xhtml index.html

<Directory "{$path}/www/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>


Whenever I have set up multiple websites on a single server this is (approximately) ALL of the config that I have ever needed. I am trying to adopt this in AMPPS, but I am not fully understanding the apparently over complicated setup that AMPS uses.

Virtualhost names are placed into /etc/hosts as 127.0.0.1 www.myserver.com for local development or left to dns for using in a deployed scenario.

Each host has a directory under {$path}/www/, e.g. www/www.myserver.com/... which under my scheme would work, but does not appear to work at all with the original AMPPS set up out of the box.

Can you help me understand why AMPPS doesn't use this much simpler approach out of the box?

Posted By: keithy on April 7, 2017, 10:57 pm | Post: 1
Ok, as long as I comment out the #Include vhosts line which contains the AMPPS vhost schem things appear to work.

Suggestion why dont you pront the output of

sudo /Applications/AMPPS/apache/bin/httpd -S

somewhere in the domain management part of AMPPS

and what about

sudo /Applications/AMPPS/apache/bin/httpd -t

cheers k.

Posted By: keithy on April 8, 2017, 6:13 pm | Post: 2
My latest incarnation of simple virtual hosting.

Quote

# Virtual hosts
#Commented Out the following
#Include conf/extra/httpd-vhosts.conf

#Added
VirtualDocumentRoot {$path}/www/%0
VirtualScriptAlias {$path}/www/%0/cgi-bin/


Posted By: olind on October 1, 2018, 9:07 am | Post: 3
I'm just trying to setup this. Are you still using this setup and if so what happens to logging? Does it all end up in the big general log file?

That would work for me. I never use multiple sites at the same time on localhost (dev-machine).

Posted By: princeofnaxos on November 15, 2018, 8:21 am | Post: 4
I fully agree! The supplied form to create a host is completely jabberish to me.
I use local domain names using vcap.me, and need the virtual host to be like they are on the production server. Therefor, I added "Include conf/extra/myhosts/*.conf" to httpd.conf (instead of commenting out the line you mentioned).

In folder "myhosts", I create my own virtual host files. Example:

<VirtualHost 127.0.0.1:80>

ServerName mydomain.com.vcap.me

ServerAlias *.mydomain.com.vcap.me

DocumentRoot path-to-docroot

<Directory path-to-docroot>
    Options FollowSymLinks Indexes
    AllowOverride All
    Order deny,allow
    allow from All
</Directory>

ErrorLog /var/log/apache2/mydomain.com-error.log

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

CustomLog /var/log/apache2/mydomain.com-access.log combined

</VirtualHost>



Quote From : keithy April 8, 2017, 6:13 pm
My latest incarnation of simple virtual hosting.

Quote

# Virtual hosts
#Commented Out the following
#Include conf/extra/httpd-vhosts.conf

#Added
VirtualDocumentRoot {$path}/www/%0
VirtualScriptAlias {$path}/www/%0/cgi-bin/


Posted By: paxtonleiny on October 26, 2023, 10:51 am | Post: 5
I’m just setting the stage here. Do you still employ this system, and if so, how is logging handled? Is everything written to the master log file?

That would be fine with me. On localhost (the machine I use to create websites), I never have more than one site open at once.

basketball stars


Powered By AEF 1.0.8 © 2007-2008 Electron Inc.