您的位置:首页 > 运维架构 > Linux

linux简单操作

2016-04-10 19:03 676 查看

1/查看和设置IP地址:
ifconfig -a
ifconfig eth0 up
dhclient eth0 或 dhcpcd eth0

2/安装
yum
安装rz/sz命令 yuminstall -y lrzsz http://www.lihuai.net/linux/commands/558.html
3/httpd: Could not reliably determine the server's fully qualified domain name 处理方式
用记事本打开 httpd.conf
将里面的 #ServerName localhost:80 注释去掉即可。
再执行 httpd

service httpd start 启动
service httpd restart 重新启动
service httpd stop 停止服务
使用service httpd status查看httpd的运行状态

然后可以通过浏览器访问 http://localhost:80 ,如果页面显示 “It works!” ,即表示apache已安装并启动成功。

4/如何yum安装centos6.5的apache http://jingyan.baidu.com/article/e5c39bf59b068739d76033f4.html
5、xftp连接linux虚拟机,账号密码都对的,提示验证信息错误
处理办法:
协议选择SFTP,不要使用FTP。
6、查看端口号:
netstat -ntlp //查看当前所有tcp端口· *注意倒数第二个字符为小写字母l
netstat -ntulp |grep 80 //查看所有80端口使用情况·
netstat -an | grep 3306 //查看所有3306端口使用情况·

7、linux下查看apache,mysql,php版本
apachectl -v
显示如下:
mysql --version
Server version: Apache/2.4.17 (Unix)
Server built: Apr 14 2016 22:40:19
查看mysql版本
mysql --version
显示如下:
mysql Ver 14.14 Distrib 5.5.46, for Linux (i686) using readline 5.1
同理:查看PHP版本,php --version
PHP 5.4.45 (cli) (built: Apr 14 2016 22:52:38)

8、给目录权限
[root@localhost ~]# chmod 777 /home/user 注:仅把/home/user目录的权限设置为rwxrwxrwx
[root@localhost ~]# chmod 777 /home/user -R 注:表示将整个/home/user目录与其中的文件和子目录的权限都设置为rwxrwxrwx
-R表示启动递归处理。
查看目录权限
ls -l 文件名
结果的第一字符表示文件类型,接下来的9个字符每3个是一组,分别表示文件拥有者、用户组、其他用户是否具有读、写、执行的权限。还有一些特殊的权限如粘附位,这些比较复杂,相对少见,一两句也说不清,请自行搜索相关博客。


                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: