Moderator: severin
### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs2"
ServerName localhost2
php_admin_value register_globals On
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs3"
ServerName localhost3
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs4"
ServerName localhost4
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs5"
ServerName localhost5
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs6"
ServerName localhost6
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs7"
ServerName localhost7
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs8"
ServerName localhost8
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs9"
ServerName localhost9
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs10"
ServerName localhost10
</VirtualHost>
127.0.0.1 localhost localhost2 localhost3 localhost4 localhost5 localhost6 localhost7 localhost8 localhost9 localhost10
Yeah, I know you can change the mamp port, but I kept it so that you didn't have to put the password. Is it not possible to make a VirtualHost default to a port besides 80?Holger Meyer wrote:Open the preferences in the MAMP application. There you can set the apache port to 80. When restarting you are asked for your password, because applications which use ports under 1024 need administrator rights. Then all hosts should work without the :8888
<?
echo("hello world !");
?>### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs/sitea"
ServerName localhosta
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs/siteb"
ServerName localhostb
</VirtualHost>
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost localhosta localhostb
255.255.255.255 broadcasthost
::1 localhost
### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Volumes/Données/sitea"
ServerName localhosta
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Volumes/Données/siteb"
ServerName localhostb
</VirtualHost>
Forbidden
You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.0.50 (Unix) PHP/4.3.11-dev Server at localhosta Port 80
Holger Meyer wrote:Open the preferences in the MAMP application. There you can set the apache port to 80. When restarting you are asked for your password, because applications which use ports under 1024 need administrator rights. Then all hosts should work without the :8888
Users browsing this forum: No registered users and 7 guests