You are not logged in.
Hello,i installed apache server on my archlinux,but i get a problem .
when i start the apache service,it works,but i can't find the httpd.pid file in /run
so i have to delete the option PIDFile in the httpd.service and add the option GuessMainPid
do you kown how to do with this
Last edited by ngiunxy (2013-11-06 06:45:34)
Offline
How did you install your apache server? (Did you use arch wiki article?) How are you starting your apache service?
English isn't my first language.
Is Arch Linux user called archer? Where are our bows and arrows?
Offline
make and make install,i write a httpd.service by myself to start the apache service
How did you install your apache server? (Did you use arch wiki article?) How are you starting your apache service?
Offline
Is there any particular reason you did not just use pacman -Syu apache ??
Unfortunately, you are off the beaten path and are not likely to get the best help when you roll your own service to start things you have hand installed.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
i have hand installed because i'm learning linux and want to konow the details of the service.
Is there any particular reason you did not just use pacman -Syu apache ??
Unfortunately, you are off the beaten path and are not likely to get the best help when you roll your own service to start things you have hand installed.
Offline
systemd unit files are thoroughly documented - start with systemd.unit(5), then move on to systemd.service(5).
That said, how did you manage to write the httpd.service you're using now?
Offline
i have hand installed because i'm learning linux and want to konow the details of the service.
That's nice, but I can tell you that I'm learning linux even when I'm using package manager. You can always look at services what were installed for you by pacman and make changes to them. May I see your httpd.service?
English isn't my first language.
Is Arch Linux user called archer? Where are our bows and arrows?
Offline
[Unit]
Description=Apache Web Server
After=network.target remote-fs.target
[Service]
Type=forking
GuessMainPid=yes
ExecStart=/usr/sbin/apachectl start
ExecStop=/usr/sbin/apachectl graceful-stop
ExecReload=/usr/sbin/apachectl graceful
PrivateTmp=true
LimitNOFILE=infinity
[Install]
WantedBy=multi-user.target
systemd unit files are thoroughly documented - start with systemd.unit(5), then move on to systemd.service(5).
That said, how did you manage to write the httpd.service you're using now?
Offline
[Unit]
Description=Apache Web Server
After=network.target remote-fs.target
[Service]
Type=forking
GuessMainPid=yes
ExecStart=/usr/sbin/apachectl start
ExecStop=/usr/sbin/apachectl graceful-stop
ExecReload=/usr/sbin/apachectl graceful
PrivateTmp=true
LimitNOFILE=infinity
[Install]
WantedBy=multi-user.target
ngiunxy wrote:i have hand installed because i'm learning linux and want to konow the details of the service.
That's nice, but I can tell you that I'm learning linux even when I'm using package manager. You can always look at services what were installed for you by pacman and make changes to them. May I see your httpd.service?
Offline
i finally find the file http.pid in the directory logs,and change the option PIDFile=/usr/local/apache/logs/httpd.pid ,now it works wll, thank you very much all the same
Offline
@ngiunxy, a couple things. First and foremost, welcome to the Arch Linux forums! Enjoy your stay.
Also, when you post things like those service files you whipped up, you need to use code tags. To see how to do this follow the 'BBCode' link at the bottom of each page.
Finally, I see you installed the apache package by hand. A big part of any distribution how it handles the packages that it is made up of. Hence a package manager is often so central to the identity of the distribution. Around here, we have pacman and friends, and in line with Arch's Keep it Simple philosophy, not only is the use of pacman pretty simple, but also the creation of packages.
Packages are made with the 'makepkg' tool that is shipped with the pacman package. 'Makepkg' uses specially formatted files called PKGBUILDs to create the package. There are also included examples already on your system, and if you can build the package by hand, you have enough knowledge to typically be able to package it up. This process is covered pretty extensively in the wiki, as is just about anything other information you may need about how to use Arch Linux.
Enjoy!
Edit: Oh yeah, and please mark your thread as [Solved] if you are satisfied with the result. You can edit the first post which will also allow you to edit the title.
Last edited by WonderWoofy (2013-11-06 05:45:18)
Offline
Great! Please mark your thread as solved.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
thank you for you propose
@ngiunxy, a couple things. First and foremost, welcome to the Arch Linux forums! Enjoy your stay.
Also, when you post things like those service files you whipped up, you need to use code tags. To see how to do this follow the 'BBCode' link at the bottom of each page.
Finally, I see you installed the apache package by hand. A big part of any distribution how it handles the packages that it is made up of. Hence a package manager is often so central to the identity of the distribution. Around here, we have pacman and friends, and in line with Arch's Keep it Simple philosophy, not only is the use of pacman pretty simple, but also the creation of packages.
Packages are made with the 'makepkg' tool that is shipped with the pacman package. 'Makepkg' uses specially formatted files called PKGBUILDs to create the package. There are also included examples already on your system, and if you can build the package by hand, you have enough knowledge to typically be able to package it up. This process is covered pretty extensively in the wiki, as is just about anything other information you may need about how to use Arch Linux.
Enjoy!
Edit: Oh yeah, and please mark your thread as [Solved] if you are satisfied with the result. You can edit the first post which will also allow you to edit the title.
Offline
I would like to suggest you to have your pid stored under /run directory. It's not important but I think it can be handy to have all pids in one directory. Happy Archering ![]()
English isn't my first language.
Is Arch Linux user called archer? Where are our bows and arrows?
Offline
I would like to suggest you to have your pid stored under /run directory. It's not important but I think it can be handy to have all pids in one directory. Happy Archering
Having it under /run is especially good because it is not an on-disk filesystem. It is on a tmpfs, so if your machine panics, you won't be left with a stale pid file that might prevent your service from successfully starting back up.
Offline