LINUX虚拟机内使用Apache搭建个人博客笔记

LINUX虚拟机内使用Apache搭建个人博客笔记

查看IP以及配IP,测试能否连接外网

IP:
	ip a
	nmcli connection   add 
			con-name zxy type 
			ethernet ifname ens33 
			ipv4.method manual 
			ipv4.addresses 192.168.62.62/24
			ipv4.gateway 192.168.62.62
	nmcli con up zxy
	ip a




挂载:
	mount /dev/cdrom /mnt
	cd /etc/yum.repos.d/
	rm -rf *
	vi zxy.repo
			[zxy]
			name=zxy
			baseurl=file:///mnt
			gpgcheck=0
			enable=1
刷新repos缓存:  yum makecache
                 yum clean all

查看Apache运行状态:  systemctl status httpd
开机自启Apache:   systemctl enale httpd
关闭防火墙(临时关闭,关机后自动开启):   systemctl stop firewalld  
  禁止开机启动防火墙:  systemctl disable firewalld
    --不关闭防火墙,放行80端口访问Apache:
  firewall-cmd --zone=public --add-port=80/tcp --permanent (permanent:永久生效,没有次参数重启后失效)

重启Apache服务 systemctl restart httpd

Httpd:
	yum install -y httpd
	systemctl status httpd
	systemctl start  httpd
	systemctl enable httpd
	firewall-cmd --permanent --add-service=http
	firewall-cmd --reload
	firewall-cmd --list-all
	cd /var/www/html




PHP:
	yum install -y php
					vim /var/www/html/info.php
								<?
									phpinfo();
								?>
					192.168.0.1/info.php




MariaDB:
	                 yum install mariadb mariadb-server -y
# 开机自启marindb 	systemctl enable mariadb
# 开启mariadb	        systemctl start  mariadb


	               mysql_secure_installation
					mysql -uroot -p123456
					vim /var/www/html/sql.php
					<?php
     						   $link=mysql_connect('localhost','root','123456');
      					           if($link)
     						     	     echo "1111";
    						   else
           						     echo "2222";
    						   mysql_close();
					 ?>
	yum install php-mysql -y
	systemctl restart httpd




解压: tar xf  wordpress-5.0.2-zh_CN.tar




Wordpress:
	<VirtualHost *:80>
        	ServerName liyukun.com
        	DocumentRoot "/code/wordpress"
		DirectoryIndex index.php index.html
		ErrorLog logs/error_wordpress_log
		CustomLog logs/access_wordpress_log combined
	</VirtualHost>
	<Directory /code/wordpress>
		AllowOverride All
		Require all granted
	</Directory>




	systemctl restart httpd
	mysql -uroot -p123456
创建wordpress数据库表:	create database wordpress;
	C:\Windows\System32\drivers\etc



无法连接FTP服务器问题:wordpress/wp-config.php  后面加代码:
define("FS_CHMOD_DIR", 0777);
define("FS_CHMOD_FILE", 0777);
define("FS_METHOD", "direct");


 wordpress更新目录创建失败问题:html路径下执行下面代码
  chown -R apache:apache wordpress





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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值