linux centos7+apache2+php 搭建一个简单得php web服务
This is basic environment to serve php application framework.
We don't need a Database in this case.
- Make a server on centos Environment
- Setting up some environment (php and apache environment)
- Touch the file and paste the web-shell sample code.
- Check Accessibility using public IP.
sudo yum install httpd #安装apache sudo systemctl start httpd.service #启动apache sudo yum install php #安装php环境 sudo yum php-mysql #安装php mysql sudo systemctl restart httpd.service #重启apache sudo vim /var/www/html/webshell.php # paste the below source code.
PS: 检查是否启动apache成功:sudo systemctl status httpd
创建php文件内容:
// webshell sample <?php system('cat /etc/hosts'); ?>
Then, access to the link with url parameters.
http://public_ip_of_your_vm/webshell.php
-> I made up the server using the above guide.
(http://xx.xx.xx.xx/webshell.php)
问题解决:
sudo systemctl start httpd.service #启动apache
sudo systemctl restart httpd.service #重启apache
sudo systemctl stop httpd.service #停止apache
sudo systemctl status httpd #检查是否启动apache成功