CentOSThis forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.
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.
Installing Apache, php, Mysql from source and systemd?
Hi,
Till now I used CentOS 6.x with SysV and there wasnt prob with services.
But in CentOS 7.x is used Systemd and I dont know how to setup services for Apache, php, Mysql installed from source.
Can you guide me plz?
Why not install them via package management? systemd supports SysV scripts in /etc/init.d as well. Otherwise, see the man pages (man systemd) and look to the "See also" sections for references to other man pages and man page levels for further reading.
then use slack or LFS
you are using CentOS ( aka RHEL) for a reason
it is DEAD STABLE and almost never crashes
it is very WELL tested and very stable AND DOSE NOT CRASH
Most server software nowadays comes with .service files for systemd, just copy them to /etc/systemd/system and enable them using systemctl. Alternatively, use the distribution provided .service files, you can extract them from the respective RPMs.
Thx for reply.
I've already did that.
I put tthe httpd.service and edited to point to binaries.
Enabled the service.
But I still cant start the service via systemctl
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true
[Install]
WantedBy=multi-user.target
I can start it via systemctl stop httpd.service
But the web server is not available trough internet.
Apr 02 17:53:04 m018 systemd[1]: PID file /usr/local/apache2/logs/httpd.pid not readable (yet?) after start.
Apr 02 17:53:04 m018 systemd[1]: Started The Apache HTTP Server.
Is it possible the service cant read httpd.conf?
And where should be set the path to httpd.conf?
Couse if I start it with: /usr/local/apache2/bin/apachectl start
Apache starts w/o problem and all is OK.
Waiting for your hints guys.
Edit1:
Actually the web is working but cant connect to mysql when is started with systemctl
Mysql is again build from source
Still investigating...
Edit2:
Just saw in phpinfo (when started with systemctl) that a lot things missing from Environment section.
Last edited by masterross; 04-02-2015 at 12:15 PM.
Systemd runs as root so its likely able to read the apache configuration fine. Is the pidfile directive in the service configuration the same as in httpd configuration?
For MySQL, what errors are seen? Are you able to connect to the DB on the command line from the same system?
I'm not sure why it gives warning about pidfile but httpd start/reboot/stop ok with systemd.
Now the problem with mysql still exist.
When httpd is ran via systemd I see environment that mysql missing from the PATH:
Quote:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
And when stared directly via /usr/local/apache2/bin/apachectl mysql exist in the env PATH:
I tried add export PATH=$PATH:/usr/local/mysql/bin
to
/usr/lib/systemd/system/httpd.service
But still I'm getting:
Connection failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Quote:
mysql> show variables like 'socket%';
+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| socket | /tmp/mysql.sock |
+---------------+-----------------+
1 row in set (0.00 sec)
Last edited by masterross; 04-03-2015 at 04:30 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.