欢迎使用CSDN-markdown编辑器

来源:互联网 发布:淘宝新人一分钱 编辑:程序博客网 时间:2024/06/05 17:46

源代码编译安装nginx续——程序的系统化

直接通过源码编译的程序无法直接启动如

[root@localhost axel-2.4]# service nginxThe service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

因此需要对系统文件进行相应配置

1. 程序的系统化

现在程序的启动路径是"/usr/local/sbin/nginx"为了以后启动程序不输入程序路径,直接输入nginx即可启动程序,则需更改环境变量。
   #vim /etc/profile.d/nginx.sh   PATH=/usr/local/nginx/sbin:$PATH   export PATH   #source /etc/profile.d/nginx.sh

标准的配置文件书写格式应该是

    PATH=/usr/local/package_name/bin:/usr/local/package_name/sbin:PATH 

但因为”/usr/local/nginx/bin”目录不存在,于是就去掉了。

2. 头文件的输出

通过创建符号链接文件的方式,把"/usr/local/nginx/incloud"目录下的头文件输出到系统头文件目录 "/usr/incloud"
    #ln -sv  /usr/local/nginx/include /usr/include/nginx

3. 库文件的输出

    #vim /etc/ld.so.conf.d/nginx.conf        /usr/local/nginx.lib    #ldconfig -v    

4. 更新man文件的路径


#vim /etc/man.config
MANPATH /usr/local/nginx/man

0 0
原创粉丝点击