chore: enable rewrite headers

This commit is contained in:
Supan Adit Pratama 2025-03-13 23:10:45 +00:00
parent d409e3855e
commit b861560edd
5 changed files with 50 additions and 3 deletions

View File

@ -0,0 +1,37 @@
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/public
ServerName localhost
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
# <Directory "/var/www/html/public">
# DirectoryIndex index.php
# AllowOverride All
# Options FollowSymlinks
# Require all granted
# </Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

View File

@ -7,4 +7,6 @@ RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/y
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -y mariadb-client
RUN docker-php-ext-install mysqli pdo pdo_mysql
RUN docker-php-ext-install mysqli pdo pdo_mysql
RUN a2enmod rewrite headers

View File

@ -21,11 +21,11 @@
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
8000
80
],
"postCreateCommand": "git config oh-my-zsh.hide-info 1 && sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html",
"portsAttributes": {
"8000": {
"80": {
"label": "PHP Artisan Serve",
"onAutoForward": "notify"
}

View File

@ -9,6 +9,7 @@ services:
volumes:
- ../:/workspaces:cached
- ./xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
- ./000-default.conf:/etc/apache2/sites-available/000-default.conf
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

View File

@ -50,6 +50,13 @@ also beginner will easily understand the flow and the structure of this applicat
</VirtualHost>
```
## DevContainer
```bash
apache2ctl start
```
## Docker Way
This app can run inside docker with official support