You are not logged in.
Thanks for the help everyone!
For those still having the problem of dir files showing up, change:
<IfModule dir_module>
DirectoryIndex index.php
</IfModule>
Offline
Hi,
I followed wiki, but I have one problem. I have set Listen 127.0.0.1:9000 in httpd.conf so that Apache doesn't listen to outside requests, but because of that it doubles listen option from php-fpm.conf. In result only one of them can be started (ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (98)).
So I'd like to ask how to configure them both so that php-fpm listens at 127.0.0.1:9000 and Apache doesn't answer to outside requests and doesn't gloom onto all bound IP addresses?
Offline
Use port 80 or 8080 for apache httpd, not 9000
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Online
Obviously :-$. I'm playing with it too long today. Thanks progandy.
Offline
Sorry, but can I bump this thread. My issue wasn't solved and I'm really hopeless now.
I can still downgrade apache back to 2.26, but that's not what I want.
thanks
Hello everybody,
Today I upgraded to apache-2.4 and it's failing to start:bře 09 17:38:08 avava systemd[1]: PID file /run/httpd/httpd.pid not readable (yet?) after start. bře 09 17:38:09 avava systemd[1]: httpd.service never wrote its PID file. Failing. bře 09 17:38:09 avava systemd[1]: Failed to start Apache Web Server. bře 09 17:38:09 avava systemd[1]: Unit httpd.service entered failed state.
I tried:
chmod /run/httpd to http remove /run/httpd specify another pidfile location in http.conf
but nothing worked. Any ideas whats wrong?
Thanks in advance.EDIT: also changing pidfile location doesn't work
It seems that it's apache bug. All the locations are writeable and apache PidFile directive has no effect.
Offline
What is the full output of
# systemctl status httpd.service
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
[viky@avava conf]$ sudo systemctl status httpd.service -l
httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
Active: failed (Result: resources) since Ne 2014-03-23 21:51:37 CET; 3s ago
Process: 13593 ExecStart=/usr/bin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 18769 (code=exited, status=1/FAILURE)
bře 23 21:51:36 avava systemd[1]: PID file /run/httpd/httpd.pid not readable (yet?) after start.
bře 23 21:51:37 avava systemd[1]: httpd.service never wrote its PID file. Failing.
bře 23 21:51:37 avava systemd[1]: Failed to start Apache Web Server.
bře 23 21:51:37 avava systemd[1]: Unit httpd.service entered failed state.
[viky@avava conf]$
Offline
Okay, that looks fine. Can you also post the contents of /usr/lib/tmpfiles.d/apache.conf and the output of
ls -ld /run/httpd
and
# systemctl status systemd-tmpfiles-setup.service
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
sorry for late response I fell asleep
[viky@avava ~]$ cat /usr/lib/tmpfiles.d/apache.conf
d /run/httpd 0755 root root -
[viky@avava ~]$ ls -ld /run/httpd
drwxr-xr-x 2 root root 80 24. bře 08.40 /run/httpd
[viky@avava ~]$ sudo systemctl status systemd-tmpfiles-setup.service
systemd-tmpfiles-setup.service - Create Volatile Files and Directories
Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-setup.service; static)
Active: active (exited) since Pá 2014-03-14 16:30:49 CET; 1 weeks 2 days ago
Docs: man:tmpfiles.d(5)
man:systemd-tmpfiles(8)
Main PID: 192 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/systemd-tmpfiles-setup.service
bře 14 16:30:49 avava systemd[1]: Started Create Volatile Files and Directories.
Offline
Since I stupidly spent quite some time debugging this myself, it might come in handy for someone else: Don't forget to uncomment the include-line for the extra/httpd-vhosts.conf-file when you're merging your httpd.conf.pacnew-file :-(
HTH.
Offline
I have nothing wrong with my vhost conf. And even apache 2.4.9 still not create pid file.
Can somebody look at those logs up here, if there's something wrong please?
I can't find anything for days. thanks
Offline
Show us content of /var/log/httpd/ files.
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline
@viky I had the same problem.
Seeing in /var/log/httpd/error.log after a failed start of apache i noted that it didn't find a module : mod_slotmem_shm.
I added it in /etc/httpd/conf/httpd.com and now apache starts well.
I hope it will help you
Bye
Offline
@piter85
Thanks a lot it was the missing slotmem_shm_module.
Now I'm kinda ashamed that I tried everything except checking log files carefully.
So sorry and thanks again
Offline
Apache is not working for me since the upgrade to 2.4. I'm getting the following error:
Syntax error on line 59 of /etc/httpd/conf/httpd.conf: Cannot load modules/mod_authn_default.so into server: /etc/httpd/modules/mod_authn_default.so: cannot open shared object file: No such file or directory
Suggestions?
Apache 2.4 doesn't have an authn_default module -- you must be using an old httpd.conf file?
A list of all modules provided by Apache 2.4 can be found here
Look through the list of mod_authn_* modules to figure out which one you need. mod_authn_file is probably the most common, and you will also need mod_authn_core
Offline
The new configuration by default uses an event based Multi Processing Module. As long as PHP isn't compiled threadsave, you can switch to the prefork MPM, which doesn't use threads.
The question is why isn't PHP compiled to be threadsafe, given the default Apache package httpd.conf configuration? Isn't this a bug that should be filed against the PHP package?
Offline
PHP recommends to compile it non-threadsafe: http://www.php.net/manual/en/install.unix.apache2.php
Offline
PHP recommends to compile it non-threadsafe: http://www.php.net/manual/en/install.unix.apache2.php
I figured it was something like this. Thanks -- this is good to know.
Given the preponderance of people who use PHP, it sounds like the Apache default should set to prefork rather than event.
Offline
Given the preponderance of people who use PHP, it sounds like the Apache default should set to prefork rather than event.
Yeah, that's what I thought too. But event is the Apache default, so the devs want to stick with that (FS#39218):
The upstream default for apache is using mpm_event. We won't switch the default MPM to prefork for just PHP.
Offline
But event is the Apache default, so the devs want to stick with that (FS#39218)
Yep, event MPM is the one recommended by Apache as faster MPM with less memory consumption. PHP folks prefer to stick to old prefork because of the thread-safety problems in third-party libs.
My guess is that over time, when apache24 and event MPM will be used more often, PHP environment will become more thread-safe and switch to event MPM by default.
Last edited by anatolik (2014-04-15 16:14:41)
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline
My only follow up comment to this is that
Given the popularity of PHP used with Apache
that the Arch PHP package is compiled without threading support
and that the default httpd.conf in the Arch Apache package uses threading
this should be documented directly in the /etc/httpd/conf/httpd.conf file like this:
...
LoadModule mpm_event_module modules/mod_mpm_event.so
# If you plan to use mod_php, you need to comment the preceding line and uncomment the following. (See the LAMP#PHP Wiki page for details.)
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
...
Last edited by pgoetz (2014-04-15 17:29:50)
Offline
I found after changing the mod prefork and doing the other suggested mods that the only other thing I really needed to do was add the following code to the httpd.conf and my php worked magically !
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Last edited by sir3x (2014-06-05 14:35:16)
Offline
Today I updated apache and php :
...
I don't understand, I followed the wiki for the lamp installation, do you know a solution ?
There are a number of solutions - the main issue is the you can't use multithreaded mpm and the single threaded php apache module.
You can switch to prefork and move on.
You can configure php-fpm instead, which isn't all that difficult but does have the issue that fastcgi has subtly different global variables[$_ENV, $_GET, etc].
Lastly you can make a copy of the php source files, edit PKGBUILD and add '--enable-maintainer-zts \' to the end of the _phpconfig options, then run makepkg and install the thread safe version.
In the end, I've had a large number of problems with the extremely Arch PHP compile options[compiling almost every extension as a shared library causes some really weird errors with sockets and filters] - so I went with the last solution. Once I'm done mucking about I'll push my changes up to github if anyone else wants to use a slightly better tuned php package.
Offline