+2
Under review

Ajenti 403 Forbidden

Andrei Rebenciuc 5 years ago updated by Ivan Nikolaev 4 years ago 17
Hi, 

I have a problem. I installed Ajenti and Ajenti V on Cent OS and everything worked fine until I restarted my server and I have two problems now.

The first problem is that I have to type the command below every time I start/restart the server for Ajenti to run properly.

server ajenti restart

I tried to run the command: chkconfig --add ajenti and does not work.

The second problem is the page below showing up on every path on the server.

403 Forbidden


nginx


I checked the file permission and is set to 755. 

Below you have some screenshots from Ajenti websites panel to understand better what configuration I use.

I am new to Linux and Ajenti and I don't know how to debug so please tell me how can I help you in understanding what causes this problem.

Thank you!

Under review
1. Run chkconfig ajenti on to enable autostart for Ajenti.
2. Are you trying to access websites that you have configured with Ajenti V?
3. Zip your /etc/nginx/conf.d and send it to e@ajenti.org along with /etc/ajenti/vh.json
1. Still does not work
2. Yes
3. I just emailed the files in an archive to you. The email has the subject: Ajenti 403 Forbidden - Andrei R.
4. I forgot to mention that I use CentOS 7
Thanks. Please check /var/log/nginx/....error.log to see exact cause of the 403.
P.S. you didn't have to paste wordpress-specific custom config bits into the phpmyadmin configuration.
I see some of these errors:
[warn] 1566#0: server name "192.168.2.5/phpMyAdmin" has suspicious symbols in /etc/nginx/conf.d/phpmyadmin.conf:10

And a lot of these:
[alert] 2685#0: setrlimit(RLIMIT_NOFILE, 100000) failed (1: Operation not permitted)
1.Domain name for phpMyAdmin is incorrect. Neither 192.168.2.5 nor 'phpMyAdmin' are domains. Actually you *must* set up some DNS entries to discern between two websites on your server. 
2. Have you manually lowered the number-of-files limits on the system? See: http://forum.nginx.org/read.php?2,248426,248427
1. I have deleted phpMyAdmin for the moment 
2. I have not modified anything but I followed the instructions and rebooted my server and still nothing.
Are you running an actual dedicated/VPS server or under some kind of OS-leve virtualization like OpenVZ? The problem is that www-data user isn't allowed to raise RLIMIT_NOFILE, but normally it should be.
Try to raise the limit manually for the www-data user: http://www.cyberciti.biz/faq/linux-increase-the-ma...
Restart NGINX and see if rlimit message still appears in the log.
I have the limit set to 1000000 and still dowes not work. I've checked the log and I still get the error.
In fact I'm running out of ideas already :(
if I execute the command setenforce 0 (disable SELinux) is working. My question is should't SELinux remain enabled?
Yes, you should keep it running, but you need to allow nginx process to raise its limit values (unfortunately I have no experience with SELinux)
Ok I understand. But what about the problem with starting Ajenti? 

Every time I reboot my server I have to use the commands: 

service ajenti restart

and I have to login into ajenti panel and go to Websites and press Restart Websites otherwise I get the error Bad Gateway
Make sure that all your Ajenti V packages are up to date, this was an issue in an old version.
Also, your web-related services (php5-fpm, nginx etc) might be disabled in autostart (use chkconfig on).
+1
For : [alert] 2685#0: setrlimit(RLIMIT_NOFILE, 100000) failed (1: Operation not permitted)

check whether 

# sestatus -b | grep httpd_setrlimit
httpd_setrlimit off
# setsebool -P httpd_setrlimit on
# sestatus -b | grep httpd_setrlimit
httpd_setrlimit on

#httpd_setrlimit - allows Nginx to adjust the number of file descriptors

Hope this helps.  Thanks Eugene for nice ajenti.