Atitit. 查找linux 项目源码位置
Atitit. 查找linux 项目源码位置
1.4. etc/nginx/conf.d/eform.conf;5
1. netstat -anp |grep 80
/etc$ netstat -anp |grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 11268/nginx: master
tcp 0 0 101.200.12.187:80 175.4.154.150:51114 ESTABLISHED 11270/nginx: worker
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://www.cnblogs.com/attilax/
1.1. 1.3 启动关闭nginx
全选复制放进笔记
## 检查配置文件是否正确# /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}
1.2. 找到nginx配置文件
网上说路径在这里,没有找到,使用搜索命令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'
1.3. ./etc/nginx/nginx.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;
}
1.4. etc/nginx/conf.d/eform.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”
2. Nginx的php安装原理
针对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
Atitit. 查找linux 项目源码位置的更多相关文章
- Atitit 项目源码的架构,框架,配置与环境说明模板 规范 标准化
Atitit 项目源码的架构,框架,配置与环境说明模板 规范 标准化 版本1.0 作者 艾龙 attilax 1. 概述:核心业务: 1 1.1. 功能文档路径 /palmWin/src/docum ...
- 如何从github上clone项目源码-linux
前言 github是目前较为流行的代码托管网站,linux系统是目前开发人员较为常用的操作系统.项目实现的过程中用到一些经典好用的源代码,可以从github上clone,本文主要介绍linux系统命令 ...
- SourceInsight 精确导入Linux kernel源码的方法
相信有很多人用 SourceInsight 查看 Linux Kernel 源码,但导入源码时会遇到一些问题.1.如果把整个源码树都导入进去,查看符号定义的时候,会发现有大量重复定义,很难找到正确的位 ...
- Linux内核源码分析方法
一.内核源码之我见 Linux内核代码的庞大令不少人“望而生畏”,也正因为如此,使得人们对Linux的了解仅处于泛泛的层次.如果想透析Linux,深入操作系统的本质,阅读内核源码是最有效的途径.我们都 ...
- Linux内核源码分析--内核启动之(3)Image内核启动(C语言部分)(Linux-3.0 ARMv7)
http://blog.chinaunix.net/uid-20543672-id-3157283.html Linux内核源码分析--内核启动之(3)Image内核启动(C语言部分)(Linux-3 ...
- Linux内核源码分析 day01——内存寻址
前言 Linux内核源码分析 Antz系统编写已经开始了内核部分了,在编写时同时也参考学习一点Linux内核知识. 自制Antz操作系统 一个自制的操作系统,Antz .半图形化半命令式系统,同时嵌入 ...
- linux内存源码分析 - 伙伴系统(初始化和申请页框)
本文为原创,转载请注明:http://www.cnblogs.com/tolimit/ 之前的文章已经介绍了伙伴系统,这篇我们主要看看源码中是如何初始化伙伴系统.从伙伴系统中分配页框,返回页框于伙伴系 ...
- 【转】Linux内核源码分析方法
一.内核源码之我见 Linux内核代码的庞大令不少人“望而生畏”,也正因为如此,使得人们对Linux的了解仅处于泛泛的层次.如果想透析Linux,深入操作系统的本质,阅读内核源码是最有效的途径.我们都 ...
- Linux内核源码分析方法_转
Linux内核源码分析方法 转自:http://www.cnblogs.com/fanzhidongyzby/archive/2013/03/20/2970624.html 一.内核源码之我见 Lin ...
随机推荐
- Sql Server系列:存储过程
1 存储过程简介 存储过程是使用T-SQL代码编写的代码段.在存储过程中,可以声明变量.执行条件判断语句等其他编程功能.在MS SQL Server 2012中存储过程主要分三类:系统存储过程.自定义 ...
- 【Win10应用开发】相对布局(RelativePanel)
外面的雨下得很大,老周就决定雨下漫笔了. 今天咱们说一个新控件——RelativePanel.本质上,它就是一个面板,面板干啥用的?面板就是一个容器,里面可以放其他对象,就像我们小时候玩的七巧板一样, ...
- Gridview里添加合计行
ShowFooter="true" ; ; ; protected void gvIncomeYG_RowDataBound(object sender, GridViewRowE ...
- C#中的readonly与const的比较
C#中有两种常量类型,分别为readonly(运行时常量)与const(编译时常量),本文将就这两种类型的不同特性进行比较并说明各自的适用场景.工作原理 readonly为运行时常量,程序运行时进行赋 ...
- JAVA--继承
项目开发遇到一个问题,稀里糊涂给实现了,现在重点讨论一下这是个什么情况,大神们如果看到希望给点指点. 问题:子类与父类具有相同的属性和方法,将子类实例化为父类,调用对应属性的get.set方法,打印出 ...
- 【开源】OSharp3.0框架解说系列:新版本说明及新功能规划预览
OSharp是什么? OSharp是个快速开发框架,但不是一个大而全的包罗万象的框架,严格的说,OSharp中什么都没有实现.与其他大而全的框架最大的不同点,就是OSharp只做抽象封装,不做实现.依 ...
- 我的编程开始(C)
一,前言 写完t-sql系列,想了想自己的编程之路,一直有个想法,把自己这两年所整理的编程知识拿出来和大家分享,本来写完t-sql是想写一些设计思想的,因为现在也是在学习和整理一些简单框架,经常泡在大 ...
- PHP类的原理
一.类的实现 类的内部存储结构: struct _zend_class_entry { char type; // 类型:ZEND_INTERNAL_CLASS / ZEND_USER_CLASS c ...
- 相克军_Oracle体系_随堂笔记010-SCN
1.SCN的意义?system change number 时间 先后.新旧 select dbms_flashback.get_system_change_number, SCN_TO ...
- (十三)WebGIS中工具栏的设计之命令模式
文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/. 1.背景 从这一章节开始我们将正式进入WebGIS的工具栏中相关功能的 ...