I have a Symfony PHP Application I want to run in a Windows server with Apache 2.4
Its files are stored in D:\Apache24\htdocs\project1\public
Its entry point is D:\Apache24\htdocs\project1\public\index.php
I followed instructions available at https://symfony.com/doc/current/setup/web_server_configuration.html and added this to my \Apache24\conf\extra\httpd-vhosts.conf
:
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot /Apache24/htdocs/project1/public
<Directory /Apache24/htdocs/project1/public>
AllowOverride All
Require all granted
</Directory>
# uncomment the following lines if you install assets as symlinks
# or run into problems when compiling LESS/Sass/CoffeeScript assets
# <Directory /var/www/project>
# Options FollowSymlinks
# </Directory>
ErrorLog /Apache24/logs/project1_error.log
CustomLog /Apache24/logs/project1_access.log combined
</VirtualHost>
But then my project takes over the server and loads at the root, and I don't want this.
I want this project's app to be served as http://localhost/project1
How can I achieve that and comply with Symfony's routing needs?
This is my http -S
output:
Included configuration files:
(*) D:/Apache24/conf/httpd.conf
(514) D:/Apache24/conf/extra/httpd-vhosts.conf
VirtualHost configuration:
*:80 localhost (D:/Apache24/conf/extra/httpd-vhosts.conf:41)
ServerRoot: "D:/Apache24"
Main DocumentRoot: "D:/Apache24/htdocs"
Main ErrorLog: "D:/Apache24/logs/error.log"
Mutex default: dir="D:/Apache24/logs/" mechanism=default
PidFile: "D:/Apache24/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: DUMP_MODULES
Define: DUMP_INCLUDES
Define: SRVROOT=D:\Apache24
Loaded Modules:
core_module (static)
win32_module (static)
mpm_winnt_module (static)
http_module (static)
so_module (static)
actions_module (shared)
alias_module (shared)
allowmethods_module (shared)
asis_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_groupfile_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cgi_module (shared)
dir_module (shared)
env_module (shared)
include_module (shared)
isapi_module (shared)
log_config_module (shared)
mime_module (shared)
negotiation_module (shared)
setenvif_module (shared)
php7_module (shared)