Atitit. 查找linux 項目源碼位置javascript
1.3. ./etc/nginx/nginx.conf4java
1.4. etc/nginx/conf.d/eform.conf;5node
2. Nginx的php安裝原理6linux
/etc$ netstat -anp |grep 80nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 11268/nginx: master laravel
tcp 0 0 101.200.12.187:80 175.4.154.150:51114 ESTABLISHED 11270/nginx: worker shell
tcp 0 0 101.200.12.187:80 175.4.154.150:51120 ESTABLISHED 11270/nginx: worker
tcp 0 0 101.200.12.187:80 175.4.154.150:51119 ESTABLISHED 11270/nginx: worker
tcp 0 0 101.200.12.187:80 175.4.154.150:51117 ESTABLISHED 11270/nginx: worker
tcp 0 0 101.200.12.187:50402 140.205.140.205:80 ESTABLISHED 30075/AliYunDun
tcp 0 0 101.200.12.187:80 175.4.154.150:51116 ESTABLISHED 11270/nginx: worker
tcp 0 0 101.200.12.187:80 175.4.154.150:51118 ESTABLISHED 11270/nginx: worker
unix 3 [ ] DGRAM 9980 366/systemd-udevd
unix 2 [ ] DGRAM 9806 1/systemd
在linux下使用top命令能夠查看進程,可是單從文件名沒法定位到進程的位置。
有以下兩種方法:
(1)獲取進程的pid,而後使用命令ls -l /proc/${pid},這個命令能夠列出該進程的啓動位置。
ls -l /proc/11268
(2)/usr/sbin/lsof | grep ${進程名稱} 這個命令也能列出進程的啓動位置。
到/proc/4431下,ls -l 會看到(須要root權限)
/etc$ ls -l /proc/11268
total 0
dr-xr-xr-x 2 root root 0 Apr 29 23:36 attr
-rw-r--r-- 1 root root 0 Apr 29 23:44 autogroup
-r-------- 1 root root 0 Apr 29 23:44 auxv
-r--r--r-- 1 root root 0 Apr 29 23:44 cgroup
--w------- 1 root root 0 Apr 29 23:44 clear_refs
-r--r--r-- 1 root root 0 Apr 28 16:08 cmdline
-rw-r--r-- 1 root root 0 Apr 29 23:44 comm
-rw-r--r-- 1 root root 0 Apr 29 23:44 coredump_filter
-r--r--r-- 1 root root 0 Apr 29 23:44 cpuset
lrwxrwxrwx 1 root root 0 Apr 29 23:44 cwd -> /
-r-------- 1 root root 0 Apr 29 23:44 environ
lrwxrwxrwx 1 root root 0 Apr 28 15:30 exe -> /usr/sbin/nginx
dr-x------ 2 root root 0 Apr 29 23:36 fd
dr-x------ 2 root root 0 Apr 29 23:44 fdinfo
-rw-r--r-- 1 root root 0 Apr 29 23:44 gid_map
-r-------- 1 root root 0 Apr 29 23:44 io
-r--r--r-- 1 root root 0 Apr 29 23:44 limits
-rw-r--r-- 1 root root 0 Apr 29 23:44 loginuid
-r--r--r-- 1 root root 0 Apr 29 23:44 maps
-rw------- 1 root root 0 Apr 29 23:44 mem
-r--r--r-- 1 root root 0 Apr 29 23:44 mountinfo
-r--r--r-- 1 root root 0 Apr 29 23:44 mounts
-r-------- 1 root root 0 Apr 29 23:44 mountstats
dr-xr-xr-x 5 root root 0 Apr 29 23:44 net
dr-x--x--x 2 root root 0 Apr 29 23:44 ns
-r--r--r-- 1 root root 0 Apr 29 23:44 numa_maps
-rw-r--r-- 1 root root 0 Apr 29 23:44 oom_adj
-r--r--r-- 1 root root 0 Apr 29 23:44 oom_score
-rw-r--r-- 1 root root 0 Apr 29 23:44 oom_score_adj
-r--r--r-- 1 root root 0 Apr 29 23:44 pagemap
-r--r--r-- 1 root root 0 Apr 29 23:44 personality
-rw-r--r-- 1 root root 0 Apr 29 23:44 projid_map
lrwxrwxrwx 1 root root 0 Apr 29 23:44 root -> /
-rw-r--r-- 1 root root 0 Apr 29 23:44 sched
-r--r--r-- 1 root root 0 Apr 29 23:44 sessionid
-r--r--r-- 1 root root 0 Apr 29 23:44 smaps
-r--r--r-- 1 root root 0 Apr 29 23:44 stack
-r--r--r-- 1 root root 0 Apr 28 15:12 stat
-r--r--r-- 1 root root 0 Apr 29 23:44 statm
-r--r--r-- 1 root root 0 Apr 28 16:08 status
-r--r--r-- 1 root root 0 Apr 29 23:44 syscall
dr-xr-xr-x 3 root root 0 Apr 29 23:44 task
-rw-r--r-- 1 root root 0 Apr 29 23:44 uid_map
-r--r--r-- 1 root root 0 Apr 29 23:44 wchan
做者:: ★(attilax)>>> 綽號:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿爾 拉帕努伊 ) 漢字名:艾龍, EMAIL:1466519819@qq.com
轉載請註明來源: http://blog.csdn.net/attilax
全選複製放進筆記
## 檢查配置文件是否正確# /usr/local/nginx-1.6/sbin/nginx -t # ./sbin/nginx -V # 能夠看到編譯選項
## 啓動、關閉# ./sbin/nginx # 默認配置文件 conf/nginx.conf,-c 指定# ./sbin/nginx -s stop
或 pkill nginx
## 重啓,不會改變啓動時指定的配置文件# ./sbin/nginx -s reload
或 kill -HUP `cat /usr/local/nginx-1.6/logs/nginx.pid`
固然也能夠將 nginx 做爲系統服務管理,下載 nginx 到/etc/init.d/,修改裏面的路徑而後賦予可執行權限。
# service nginx {start|stop|status|restart|reload|configtest}
網上說路徑在這裏,沒有找到,使用搜索命令find找到。。
8.修改配置文件
cd /usr/local/nginx/conf
vi nginx.conf
/usr/local$ cd /
/$ find . -name 'nginx.conf'
./etc/nginx/nginx.conf
find . -name 'fcgi.conf'
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 300m;
sendfile on;
tcp_nopush on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
keepalive_timeout 60;
tcp_nodelay on;
server_tokens off;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
include /etc/nginx/conf.d/*.conf;
}
server {
listen 80;
server_name qinbd.com www.qinbd.com;
root /mnt/www/eform/public;
index index.php index.html index.htm;
charset utf-8;
location / {
#laravel加入
try_files $uri $uri/ /index.php?$query_string;
}
location = /robots.txt { allow all; access_log off; log_not_found off; }
location = /favicon.ico { allow all; access_log off; log_not_found off; }
error_page 401 /401.html;
error_page 403 /403.html;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location ~ \.php$ {
root /mnt/www/eform/public;
#sock開啓
fastcgi_pass unix:/var/run/php5-fpm.sock;
#TCP開啓
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#寫入上一步本身建立fast-cgi的配置文件路徑
include fcgi.conf;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
#deny all;
}
}
/$ find . -name 'fcgi.conf'
./etc/nginx/fcgi.conf
find . -name 「php.ini」
find . -name 「php-fpm.conf」
針對Nginx的php安裝和針對apache的php安裝是有區別的,由於Nginx中的php是以fastcgi的方式結合nginx的,能夠理解爲nginx代理了php的fastcgi,而apache是把php做爲本身的模塊來調用
/etc/nginx$ netstat -anp |grep php
unix 2 [ ACC ] STREAM LISTENING 14495 1068/php-fpm: maste /var/run/php5-fpm.sock
unix 3 [ ] STREAM CONNECTED 14493 1068/php-fpm: maste
unix 3 [ ] STREAM CONNECTED 14494 1068/php-fpm: maste
/$ find . -name 'php.ini'
./etc/php.ini
du -sh /mnt/www/eform/public
/$ du -sh /mnt/www/eform/public
3.4G/mnt/www/eform/public
/$ du -sh /mnt/www/eform/
3.6G/mnt/www/eform/
/$ du -sh /mnt/www/
3.6G/mnt/www/
MariaDB數據庫管理系統是MySQL的一個分支,主要由開源社區在維護,採用GPL受權許可 MariaDB的目的是徹底兼容MySQL,包括API和命令行,使之能輕鬆成爲MySQL的代替品。
root@iZ94mqp30dmZ:~# cd /
root@iZ94mqp30dmZ:/# find -name 'httpd.conf'
./root/sh-1.5.0-Ubuntu-14.04/apache/config-httpd/config-httpd-2.2.22/httpd.conf
./root/sh-1.5.0-Ubuntu-14.04/httpd-2.2.29/docs/conf/httpd.conf
./alidata/server/httpd-5/conf/original/httpd.conf
./alidata/server/httpd-5/conf/httpd.conf
./alidata/server/httpd-2/conf/original/httpd.conf
./alidata/server/httpd-2/conf/httpd.conf
./alidata/server/httpd-4/conf/original/httpd.conf
./alidata/server/httpd-4/conf/httpd.conf
./alidata/server/httpd-6/conf/original/httpd.conf
./alidata/server/httpd-6/conf/httpd.conf
./alidata/server/httpd-3/conf/original/httpd.conf
./alidata/server/httpd-3/conf/httpd.conf
01:50 exe -> /alidata/server/httpd-4/bin/httpd