Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Another Q: For the aliases for each virtual-host do I need it to be <domain.com.aliases.conf??
Asking that as always had aliases.conf in either /etc/apache2/conf-available or /etc/apache2/conf-enabled and never considered where the alias file needs to be for each virtual-host.
Just “Forbidden”? No code...I’d expect a 5XX code.
What’s in the httpd error log when this happens? When a website doesn’t work as expected, the access and error logs are the first place to go.
I’ll go check what I have at half-time. My PHPMyAdmin installation works a treat.
Just “Forbidden”? No code...I’d expect a 5XX code.
What’s in the httpd error log when this happens? When a website doesn’t work as expected, the access and error logs are the first place to go.
I’ll go check what I have at half-time. My PHPMyAdmin installation works a treat.
scasey,
Error log:
Code:
[Tue Jan 19 00:05:22.116192 2021] [mpm_prefork:notice] [pid 25665] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Tue Jan 19 00:05:22.116256 2021] [core:notice] [pid 25665] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jan 19 10:10:14.272188 2021] [mpm_prefork:notice] [pid 1029] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Tue Jan 19 10:10:14.312924 2021] [core:notice] [pid 1029] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jan 19 10:21:19.669093 2021] [access_compat:error] [pid 1056] [client 127.0.0.1:57880] AH01797: client denied by server configuration: /var/www/favicon.ico, referer: http://localhost/
[Tue Jan 19 10:27:18.978479 2021] [access_compat:error] [pid 1052] [client 127.0.0.1:57912] AH01797: client denied by server configuration: /var/www/favicon.ico, referer: http://localhost/phpmyadmin
[Tue Jan 19 10:27:23.525588 2021] [access_compat:error] [pid 1052] [client 127.0.0.1:57912] AH01797: client denied by server configuration: /usr/share/phpmyadmin
[Tue Jan 19 10:27:23.690134 2021] [access_compat:error] [pid 1052] [client 127.0.0.1:57912] AH01797: client denied by server configuration: /var/www/favicon.ico, referer: http://localhost/phpmyadmin
According to the log I have a config issue, but back to my question of which of the 2 config files I posted? and do I need to delete one?
Was talking to support at SEO-Panel, so checked in /var/www/html and the directory for seopanel is there, but phpmyadmin is not. Searching to see where /phpmyadmin got installed.
Only find it at: /etc/phpmyadmin/ and no place else. Am I supposed to have the directory:
"/var/www/html/phpmyadmin"
Or is this declared through an alias definition. That is what I remember it being. I do have:
All 3 index.html files are displaying in the browser but still have this issues:
1.) PHP works at command line, but not in the browser,
2.) PHPmyAdmin giving "Forbidden" message in the browser,
3.) SEOPanel giving "Forbidden" message in the browser,
Open to suggestions on these issues!
Wow! Have been out on other projects for about 3 weeks, have not updated, upgraded, nor rebooted and now PHP on the CMD line is not working. Checked the error logs and no errors. I'm doing a re-install to see if it clears then.
I have so many other issues with Kubuntu/Ubuntu 18.04, I'm totally thinking the OS is total crap!
Wow! Have been out on other projects for about 3 weeks, have not updated, upgraded, nor rebooted and now PHP on the CMD line is not working. Checked the error logs and no errors. I'm doing a re-install to see if it clears then.
I have so many other issues with Kubuntu/Ubuntu 18.04, I'm totally thinking the OS is total crap!
Am I right?
TBNK
Reinstall of the entire thing will erase all your hard work in configuring things. Maybe just reinstall php and associates instead.
Actually, if you always make certain to keep a copy of the original config files before you make changes it is easy to restore them and start over. That avoids reinstalling software which often does not replace the mucked up config files anyway.
Once you have something working properly a backup copy of the working config file is often a lifesaver as well.
Last edited by computersavvy; 02-11-2021 at 07:58 PM.
Reinstall of the entire thing will erase all your hard work in configuring things. Maybe just reinstall php and associates instead.
Actually, if you always make certain to keep a copy of the original config files before you make changes it is easy to restore them and start over. That avoids reinstalling software which often does not replace the mucked up config files anyway.
Once you have something working properly a backup copy of the working config file is often a lifesaver as well.
computersavvy,
Ok! I posted the issue on the "Apache Lounge" forum at:
but as usual these "non gurus" violated the 2nd of the 2 cardinal rules of all data processing:
1.) Never never never never never never never never be ambiguous,
2.) Never never never never never never never never assume anything.
So, assuming you already know, left out the filename of where to make these changes, but I'm guessing it is the "/etc/apache2/sites-available/000-default.config" file, but it might be in the "/etc/apache2/conf-available/" directory instead.
See what is not explained is the the following files are all needed to properly define/config Apache:
/etc/hosts
/etc/apache2/apache.conf
/etc/apache2/sites-available/000-default.conf
/etc/apache2/sites-available/vhost1.conf
/etc/apache2/sites-available/vhost2.conf
....
Now this is true for all Debian/Kubuntu/Ubuntu flavors, but different for other Unix/Linux flavors, so not listing these and where/which files need modification, does not directly answer the config problems at hand leaving the end user to actually assume certain things and instead of directly effecting a fix, must then assume and experiment, until he/she, through experimentation, finds the answer, since it "was not answered" by this HOWTO writeup!
So I'm now experimenting, as that is the only way to effect a fix!
OK! Experimenting with the following code in /etc/apache2/sites-available/000-default.conf
Code:
Listen 80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order deny,allow
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
<Location />
Deny from all
Options None
ErrorDocument 403 Forbidden.
</Location>
</VirtualHost>
<VirtualHost localhost>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory /var/www/>
ServerName localhost
ServerAlias localhost
</VirtualHost>
<VirtualHost TBotNik,com:80>
ServerAdmin webmaster@TBotNik,com
DocumentRoot /3T/Syncs/TBotNik/
<Directory /3T/Syncs/TBotNik/>
ServerName www.TBotNik,com
ServerAlias TBotNik,com
</VirtualHost>
<VirtualHost 'Webs-R-Us.com':80>
ServerAdmin 'webmaster@Webs-R-Us.com'
DocumentRoot '/3T/Syncs/Webs-R-Us/'
<Directory '/3T/Syncs/Webs-R-Us/'>
ServerName 'www.Webs-R-Us.com'
ServerAlias 'Webs-R-Us.com'
</VirtualHost>
<VirtualHost TBNK_SVR.com:80>
ServerAdmin webmaster@TBNK_SVR.com
DocumentRoot /3T/Syncs/
<Directory /3T/Syncs/>
ServerName www.TBNK_SVR.com
ServerAlias TBNK_SVR.com
</VirtualHost>
I restart apache and get these errors from:
Code:
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
Where "systemctl status apache2.service" shows:
Code:
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Thu 2021-05-06 00:29:58 CDT; 12s ago
Process: 12197 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE)
Process: 27762 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
Process: 12653 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
Main PID: 6384 (code=exited, status=0/SUCCESS)
May 06 00:29:58 TBNK-SVR systemd[1]: Starting The Apache HTTP Server...
May 06 00:29:58 TBNK-SVR systemd[1]: apache2.service: Control process exited, code=exited status=1
May 06 00:29:58 TBNK-SVR systemd[1]: apache2.service: Failed with result 'exit-code'.
May 06 00:29:58 TBNK-SVR systemd[1]: Failed to start The Apache HTTP Server.
May 06 00:29:58 TBNK-SVR apachectl[12653]: apache2: Syntax error on line 61 of /etc/apache2/apache2.conf: Synta
May 06 00:29:58 TBNK-SVR apachectl[12653]: Action 'start' failed.
May 06 00:29:58 TBNK-SVR apachectl[12653]: The Apache error log may have more information.
and "journalctl -xe" shows:
Code:
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit apache2.service has failed.
--
-- The result is RESULT.
May 06 00:14:24 TBNK-SVR apachectl[12492]: apache2: Syntax error on line 61 of /etc/apache2/apache2.conf: Synt
May 06 00:14:24 TBNK-SVR apachectl[12492]: Action 'start' failed.
May 06 00:14:24 TBNK-SVR apachectl[12492]: The Apache error log may have more information.
May 06 00:17:01 TBNK-SVR CRON[12522]: pam_unix(cron:session): session opened for user root by (uid=0)
May 06 00:17:01 TBNK-SVR CRON[12523]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
May 06 00:17:01 TBNK-SVR CRON[12522]: pam_unix(cron:session): session closed for user root
May 06 00:18:44 TBNK-SVR systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit apache2.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit apache2.service has begun starting up.
May 06 00:18:44 TBNK-SVR apachectl[12542]: apache2: Syntax error on line 61 of /etc/apache2/apache2.conf: Synt
May 06 00:18:44 TBNK-SVR apachectl[12542]: Action 'start' failed.
May 06 00:18:44 TBNK-SVR apachectl[12542]: The Apache error log may have more information.
May 06 00:18:44 TBNK-SVR systemd[1]: apache2.service: Control process exited, code=exited status=1
May 06 00:18:44 TBNK-SVR systemd[1]: apache2.service: Failed with result 'exit-code'.
May 06 00:18:44 TBNK-SVR systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit apache2.service has failed.
--
-- The result is RESULT.
And both are pointing to line 61, which is the "</VirtualHost>" closing argument for the declaration of VHost "Webs-R-Us", but then reports it as being "TBNK-SVR". See this is why debugging Apache is so difficult as it never ever points to the actual error but instead gives you all these lies about code, configs and definition surrounding the problem, but never the problem itself and you have to become an Apache guru, or consult an Apache guru to actually "interpret" the error results itself and though it tells you the defining error is explained in the error log, the error log has less information than these 2 msg sources, so leaves you clueless about the error.
What I suspect it that the "-"'s in the "Webs-R-Us" and "TBNK-SVR" definition are why the errors are occuring, but understand I have defined multiple time (over 100 times) vhosts on remote machines, via "CPanel" domains with the "-" in them qnd they work just fine.
So what is the syntax issues here or do I just use include statements to pull in the actual .conf files for each vhost. I also realize that all conf files in "sites-available" are symlinked to "sites-enabled" or should be and checking my "sites-enabled" to see if the system established the symlinks and if not do so manually!
And both are pointing to line 61, which is the "</VirtualHost>" closing argument for the declaration of VHost "Webs-R-Us", but then reports it as being "TBNK-SVR". See this is why debugging Apache is so difficult as it never ever points to the actual error but instead gives you all these lies about code, configs and definition surrounding the problem, but never the problem itself and you have to become an Apache guru, or consult an Apache guru to actually "interpret" the error results itself and though it tells you the defining error is explained in the error log, the error log has less information than these 2 msg sources, so leaves you clueless about the error.
Apache is not prevaricating, I suspect the error is actually the closing virtual host tag. That is not valid within <Directory ...> context so that is where the error is reported:
Read the error messages and try to understand what they are telling you, and read your own configs with a more critical eye rather than jump to the conclusion that the application is telling lies.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.