openSUSE操作系统搭建使用记录

操作系统版本:openSUSE-LEAP-15.0-x86-64

一、常规操作

  • 基本操作

1.查看IP信息

ip a

2.安装命令格式

zypper install XXX
3.安装使用ifconfig命令

zypper install net-tools-deprecated

4.开启sshd服务/查看服务状态/设为开机启动

systemctl start sshd/systemctl status sshd/systemctl enable sshd

5.防火墙开端口命令

firewall-cmd --add-port=22/tcp

6.添加用户

useradd -d /home/oracle -m -s /bin/bash oracle

设置密码:passwd oracle

  • vncserver安装使用

1.查看vnc软件包情况
cnf vncserver

2.安装软件包
zypper istall xorg-x11-Xvnc

3.启动服务
vncserver -geometry 1024x768 -depth 16

4.客户端连接
vncviewer 服务器IP:1

二、web应用服务器搭建(LNMP环境)

  • MariaDB数据库

1.安装
zypper in mariadb-tools mariadb mariadb-client

2.启动MariaDB
设为开机启动:systemctl enable mysql.service
启动数据库:systemctl start mysql.service

3.设置数据库root密码
mysqladmin -u root password 12345

4.进入数据库后台
mysql -u root -p -h localhost

5.设置新的普通用户
create user 'user1'@'%' identified by '12345';
赋予管理员权限:grant all privileges on *.* to 'user1'@'%';

6.运行远程访问的配置
编辑配置文件:vi /etc/my.cnf
设置文件里的内容:bind-address=*

  • php

1.安装
zypper install php7
zypper in php7-pear

2.查看
php -h
pear help

  • nginx

1.安装nginx
zypper install nginx

2.开启nginx服务
设为开机自启:systemctl enable nginx
启动服务:systemctl start nginx

3.应用目录位置
/srv/www/htdocs

4.安装php7-fpm
zypper install php7-fpm

5.编辑php-fpm.conf
在/etc/php7/fpm/目录有默认的配置文件php-fpm.conf.default, 要启用php7-fpm必须复制一个php-fpm.conf放在/etc/php7/fpm/目录:
cp /etc/php7/fpm/php-fpm.conf.default   /etc/php7/fpm/php-fpm.conf

6.进入到/etc/php7/fpm/php-fpm.d目录里将www.conf.default文件改名为www.conf
注:执行php-fpm若没报error则配置文件没问题。

7.启动php的FastCGI进程
设为开机自启:systemctl enable php-fpm
启动:systemctl start php-fpm
注:若启动失败,先停nginx服务,然后执行netstat -anp|grep 9000,kill -9 pid,重新systemctl start php-fpm

8.配置nginx,详见下节

  • nginx配置 

配置nginx:
用root权限编辑/etc/nginx/nginx.conf ,参考如下配置:

  location / {
    root    /srv/www/htdocs/;
    index   index.php index.html index.htm ;
  }

  location ~ \.php$ {
    root          /srv/www/htdocs;
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /srv/www/htdocs$fastcgi_script_name;
    include       fastcgi_params;
  }


编辑后保存。 

重启nginx:

systemctl restart nginx.service

三、FTP服务器搭建

1.安装
zypper in vsftpd

2.开放21端口
firewall-cmd --add-port=21/tcp

3.启动ftp服务
systemctl start vsftpd

4.开启ftp开机启动
systemctl enable vsftpd

5.编辑配置文件
vi /etc/vsftpd.conf
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES

6.文件夹位置
匿名:/srv/ftp
系统用户:/home/系统用户

7.给文件夹赋予权限 
chmod 777 文件夹

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值