Begginer Post - Issues running an SSL site

A

Anonymous

Guest
Hello, I am playing with laravel and vue js, however my post is about LAMPP, particularly the apache component of it.

I have configured a systemctl startup script that will run automatically after a reboot.
Path: /etc/systemd/system/lampp-apache.service
Content:
[Unit]
Description=LAMPP-Apache

[Service]
ExecStart=/opt/lampp/lampp start
ExecStop=/opt/lampp/lampp stop
Type=forking

[Install]
WantedBy=multi-user.target

I have created a self-signed certificate for my test intranet which is be.test.com which is also configured in LAMPP's virtualhost file.
Path: /opt/lamp/etc/extra/httpd-vhosts.conf
Content:
<VirtualHost *:443>
DocumentRoot "/opt/lampp/htdocs/intranet_be/public"
DirectoryIndex "/opt/lampp/htdocs/intranet_be/public/index.php"
SSLEngine on
SSLCertificateFile /etc/ssl/crt/be.test.com.crt
SSLCertificateKeyFile /etc/ssl/crt/be.test.com.key
ServerName be.test.com
ServerAlias be.test.com
<Directory /opt/lampp/htdocs/intranet_be/public/>
Options +FollowSymLinks +Indexes
AllowOverride All
Require all granted
order allow,deny
allow from all
</Directory>
</VirtualHost>

after i restart the LAMPP service I created by issuing "sudo systemctl restart lampp-apache.service" i can see the service running, however when I visit the site (https://be.test.com) it shows me the following message.

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403
be.test.com
Apache/2.4.46 (Unix) OpenSSL/1.1.1i PHP/8.0.1 mod_perl/2.0.11 Perl/v5.32.0

After several duckduckgo/google searches most suggest it might be a permission issue on the directory "/opt/lampp/htdocs/intranet_be", so i took a look at the directory (ls -la)
total 368
drwxrwxr-x 12 sheenlim08 sheenlim08 4096 Jan 30 07:16 .
drwxr-xr-x 14 sheenlim08 sheenlim08 4096 Mar 13 07:34 ..
-rw-rw-r-- 1 sheenlim08 sheenlim08 220 Jan 19 15:20 .editorconfig
-rw-rw-r-- 1 sheenlim08 sheenlim08 1068 Mar 13 08:11 .env
-rw-rw-r-- 1 sheenlim08 sheenlim08 811 Jan 19 15:20 .env.example
-rw-rw-r-- 1 sheenlim08 sheenlim08 111 Jan 19 15:20 .gitattributes
-rw-rw-r-- 1 sheenlim08 sheenlim08 191 Jan 19 15:20 .gitignore
-rw-rw-r-- 1 sheenlim08 sheenlim08 181 Jan 19 15:20 .styleci.yml
-rw-rw-r-- 1 sheenlim08 sheenlim08 3780 Jan 19 15:20 README.md
drwxrwxr-x 7 sheenlim08 sheenlim08 4096 Jan 19 15:20 app
-rwxr-xr-x 1 sheenlim08 sheenlim08 1686 Jan 19 15:20 artisan
drwxrwxr-x 3 sheenlim08 sheenlim08 4096 Jan 19 15:20 bootstrap
-rw-rw-r-- 1 sheenlim08 sheenlim08 1681 Feb 27 01:26 composer.json
-rw-rw-r-- 1 sheenlim08 sheenlim08 270854 Feb 27 01:27 composer.lock
drwxrwxr-x 2 sheenlim08 sheenlim08 4096 Feb 27 01:27 config
drwxrwxr-x 5 sheenlim08 sheenlim08 4096 Jan 19 15:20 database
-rw-rw-r-- 1 sheenlim08 sheenlim08 473 Jan 19 15:20 package.json
-rw-rw-r-- 1 sheenlim08 sheenlim08 1202 Jan 19 15:20 phpunit.xml
drwxrwxr-x 2 sheenlim08 sheenlim08 4096 Jan 19 15:20 public
drwxrwxr-x 6 sheenlim08 sheenlim08 4096 Jan 19 15:20 resources
drwxrwxr-x 2 sheenlim08 sheenlim08 4096 Jan 19 15:20 routes
-rw-rw-r-- 1 sheenlim08 sheenlim08 563 Jan 19 15:20 server.php
drwxrwxr-x 5 sheenlim08 sheenlim08 4096 Jan 19 15:20 storage
drwxrwxr-x 4 sheenlim08 sheenlim08 4096 Jan 19 15:20 tests
drwxrwxr-x 44 sheenlim08 sheenlim08 4096 Feb 27 01:27 vendor
-rw-rw-r-- 1 sheenlim08 sheenlim08 559 Jan 19 15:20 webpack.mix.js

then added the root user on the sheenlim08, i only did this because i think i need to give root access to the files on the directory the virtualhost is configured on the LAMPP virtualhost file, after all the apache application is being run via the command "sudo systemctl restart lampp-apache.service".

Am i doing this right? are process ran by "sudo systemctl" ran under root? or is sudo just required to execute systemctl, either way i cant figure out why the site is showing "You don't have permission to access the requested directory. There is either no index document or the directory is read-protected."

Any ideas?
 
I was able to resolve the issue by removing the line "DirectoryIndex "/opt/lampp/htdocs/intranet_be/public/index.php"" in the virtualhost configuration.
 
Back
Top