LAMP网站部署(Discuz论坛网站部署)

目录

mysql命令

语法

选项

参数

实例

安装php

安装Mariadb

关掉防火墙和selinux

启动HTTP服务

初始化数据库

查看数据库是否创建成功

修改HTTP的配置文件

浏览器打开

将以下所有目录都加上权限

最后首页效果


mysql命令

是MySQL数据库服务器的客户端工具,它工作在命令行终端中,完成对远程MySQL数据库服务器的操作。

语法

mysql(选项)(参数)

选项

-h:MySQL服务器的ip地址或主机名;

-u:连接MySQL服务器的用户名;

-e:执行mysql内部命令;

-p:连接MySQL服务器的密码。

参数

数据库:指定连接服务器后自动打开的数据库。

实例

安装php

[root@Server ~]#yum install php*

安装Mariadb

[root@Server ~]#yum install mariadb

[root@Server ~]#yum install mariadb-server 

关掉防火墙和selinux

[root@Server ~]# systemctl stop firewalld.service

[root@Server ~]# setenforce 0

启动HTTP服务

[root@Server ~]# systemctl start httpd

初始化数据库

[root@Server ~]# mysql_secure_installation  --初始化数据库

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody

can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] y

Enabled successfully!

Reloading privilege tables..

 ... Success!

You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] y

 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y

 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] y

 - Dropping test database...

 ... Success!

 - Removing privileges on test database...

 ... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] y

 ... Success!

[root@Server ~]# mysql -u root -p     ---选择root用户登录数据库

Enter password:

MariaDB [(none)]> create database luntan;  --创建luntan数据库

查看数据库是否创建成功

切换到mysql数据库查看root用户的密码是否有设置

修改HTTP的配置文件

[root@Server upload]# vim /etc/httpd/conf.d/vhosts.conf

<VirtualHost 192.168.221.136:8909>

        #精确定位

        DocumentRoot /luntan

        #服务器主机命名

        ServerName 192.168.221.136

</VirtualHost>

<Directory /luntan>

        AllowOverride none

        Require all granted

</Directory>

浏览器打开

http://192.168.221.136:8909/upload

打开之后发现以下的目录都不可写或者不存在,这是由于没有权限而导致的

将以下所有目录都加上权限

[root@Server upload]# chmod o+w ./config/ ./data/ uc_client/ uc_server/ -R

输入数据库等信息就安装成功了

点击首页发现会有一个提示删除在此目录下的index.php文件

[root@Server install]# pwd

/luntan/upload/install

[root@Server install]# ls

data  include  index.php  static

[root@Server install]# rm index.php

rm:是否删除普通文件 'index.php'?y

最后首页效果

  • 53
    点赞
  • 31
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

妍妍的宝贝

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值