linux命令1(服务器启动相关)

来源:互联网 发布:ug编程用在什么地方 编辑:程序博客网 时间:2024/05/22 13:38

将rysnc和mongod加到linux启动脚本的方法如下:

在/etc/rc.d/rc.local文件末尾加入以下两行。

rsync --daemon

cd /dir/MongoDB ; sh mongo_start.sh

这篇文章讲的很好。

http://linux.chinaunix.net/techdoc/beginner/2008/09/05/1030518.shtml

lsof -i:80 

netstat -apn|grep <端口号> 

/usr/local/nginx/conf

rpm -qa | grep redis | xargs rpm -ql

redis目录

aaa/daemon/redis/bin

redis客户端启动命令;

./redis-cli

redis服务端启动命令:

./redis-server

启动redis客户端

service nginx restart 

service mysqd restart 

chown apache:apache templates_c/

grant select,update on jeecnDB.* to jeecn@localhost identified by ‘jeecn’

启动apache服务 

service httpd start     

service httpd restart

apache配置文件地址:

vi /etc/httpd/conf/httpd.conf

打开Apache的错误提示

如果使用PHP + Apache,在缺省设置下,PHP编码错误是不会提示的,这对于开发来说,是很不方便的。可以使用以下步骤打开出错提示:

1. 打开php.ini文件。

以我的vps为例,这个文件在: /etc/php5/apache2 目录下。

2. 搜索并修改下行,把Off值改成On

display_errors = Off

3. 搜索下行

error_reporting = E_ALL & ~E_NOTICE

或者搜索:

error_reporting = E_ALL & ~E_DEPRECATED

修改为

error_reporting = E_ALL | E_STRICT

4. 修改Apache的 httpd.conf

以我的 Ubuntu 为例, 这个文件在:/etc/apache2/  目录下,这是一个空白文件。

添加以下两行:

php_flag display_errors        on

php_value error_reporting       2039

5. 重启Apache,就OK了

重启命令:sudo /etc/init.d/apache2 restart

添加httpd服务:

    [root@localhost ~]# chkconfig --add httpd

    2、查看httpd服务:[root@localhost ~]# chkconfig  --list|grep httpd

    httpd           0:关闭 1:关闭  2:关闭 3:关闭  4:关闭  5:关闭  6:关闭

    3、开机时自动运行httpd服务:

    [root@localhost ~]# chkconfig --level 345 httpd on

    4、查看httpd服务状态:

    [root@localhost ~]# chkconfig --list|grep httpd

启动mongodb服务器

MongoDB/mongo_start.sh

原创粉丝点击