How to create virtual hosts in MAMP?

While googling, I found these steps to easily create virtual hosts on MAMP: Open your console in mac and edit your hosts file like this sudo vim /etc/hosts This opens a system file that contains the following line: 127.0.0.1 localhost add your desired host name after local host: 127.0.0.1 localhost mysite.loc press ESC, then :wq! … Read more

error_log per Virtual Host?

If somebody comes looking it should look like this: <VirtualHost *:80> ServerName example.com DocumentRoot /var/www/domains/example.com/html ErrorLog /var/www/domains/example.com/apache.error.log CustomLog /var/www/domains/example.com/apache.access.log common php_flag log_errors on php_flag display_errors on php_value error_reporting 2147483647 php_value error_log /var/www/domains/example.com/php.error.log </VirtualHost> This is for development only since display_error is turned on. You will notice that the Apache error log is separate from the … Read more

Apache default VirtualHost

I found the answer: I remembered that Apache uses the first block if no other matching block is found, so I’ve added a block without a serveralias at the top of the blocks: NameVirtualHost * <VirtualHost *> DocumentRoot /defaultdir/ </VirtualHost> <VirtualHost *> ServerAdmin [email protected] DocumentRoot /someOtherDir/ ServerAlias ip.of.the.server </VirtualHost> <VirtualHost *> ServerAdmin [email protected] DocumentRoot /someroot/ … Read more

Adding VirtualHost fails: Access Forbidden Error 403 (XAMPP) (Windows 7)

Okay: This is what I did now and it’s solved: My httpd-vhosts.conf looks like this now: <VirtualHost dropbox.local:80> DocumentRoot “E:/Documenten/Dropbox/Dropbox/dummy-htdocs” ServerName dropbox.local ErrorLog “logs/dropbox.local-error.log” CustomLog “logs/dropbox.local-access.log” combined <Directory “E:/Documenten/Dropbox/Dropbox/dummy-htdocs”> # AllowOverride All # Deprecated # Order Allow,Deny # Deprecated # Allow from all # Deprecated # –New way of doing it Require all granted </Directory> … Read more