I'm stuck with Apache
with Passenger
configuration. I spent a few days looking for a solution. I follow this instructions. I'm getting this message in the browser:
Forbidden
You don't have permission to access this resource.
httpd.conf
# Use /usr/bin/node by default.
PassengerNodejs /usr/bin/node
<VirtualHost *:80>
ServerName example.com
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{SERVER_NAME} =example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerName example.com
# Tell Apache and Passenger where your app's code directory is
DocumentRoot /var/www/example.com
PassengerAppRoot /var/www/example.com/
# Tell Passenger that your app is a Node.js app
PassengerAppType node
PassengerStartupFile app.js
# Relax Apache security settings
<Directory /var/www/example.com>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
Require all granted
</Directory>
CustomLog /var/log/httpd/example.com_access.log combined
ErrorLog /var/log/httpd/example.com_error.log
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.com/fullchain.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
In /var/log/httpd/example.com_error.log I get:
[Sat Sep 04 07:24:00.473120 2021] [autoindex:error] [pid 907862:tid 139932467173120] [client 85.89.184.79:50337] AH01276: Cannot serve directory /var/www/example.com/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
File rights
drwxr-xr-x. 5 root root 102 Sep 3 23:53 ..
drwxr-xr-x. 8 root root 163 Sep 4 07:11 .git
-rw-r--r--. 1 root root 35 Sep 4 07:11 .gitignore
-rw-r--r--. 1 root root 215 Sep 4 07:11 README.md
-rw-r--r--. 1 root root 390 Sep 4 07:11 app.js
drwxr-xr-x. 3 root root 21 Sep 4 07:12 node_modules
-rw-r--r--. 1 root root 2655 Sep 4 07:12 npm-shrinkwrap.json
-rw-r--r--. 1 root root 318 Sep 4 07:11 package.json
drwxr-xr-x. 2 root root 22 Sep 4 07:11 public
curl http://127.0.0.1:3000/
returns Hello from Node.js/io.js + Connect.js!
Is there anything i should check?