Docker下的webserver含centos 7.3 php
2017-05-05 本文已影响73人
波哥教你学
运行镜像
本镜像包含一个可以运行的webserver。含centos 7.3 php-7.1.4 nginx-1.12.0 mysql-5.7 redis-3.2.3
拉取镜像
docker pull ymark/centos7.3
直接在后台运行,并暴露接口
docker run --privileged -itd -p 80:80 -p 3306:3306 -p 6379:6379 -p 11211:11211 -w /root --name webserver ymark/centos7.3 /usr/sbin/init
连接容器并操作
docker exec -it webserver /bin/bash
直接在浏览器里访问
http://localhost
http://127.0.0.1
默认网站路径在 /var/www
Mysql
root 只可以localhost连 密码 Mark*123456
apps 任意主机都可以连 密码 Mark*123456
redis
telnet 127.0.0.1 6379
memcached
telnet 127.0.0.1 11211
开启、关闭、重启容器
docker start webserver
docker stop webserver
docker restart webserver
Webserver 具体配置信息如下:
@author mark
@email tailcome@qq.com
The Mysql ROOT password is
Mark*123456
The Root user only use for localhost
For any host, the user and password is below
user apps
password Mark*123456
PHP 7.1.4
homepage
browser http://127.0.0.1 or http://localhost
The init path is:
/var/www
port
/var/run/php-fpm.sock
paths
/etc/php.ini
/etc/php-fpm.conf
/etc/php-fpm.d/www.conf
extension
/etc/php.d/*.ini
service
systemctl enable php-fpm
systemctl start php-fpm
systemctl stop php-fpm
Nginx 1.12.0
port
80
paths
/etc/nginx/nginx.conf
user define server
/etc/nginx/conf.d/apps.conf
server default directory
/var/www/
service
systemctl enable nginx
systemctl start nginx
systemctl stop nginx
Mysql 5.7
root password
only con
mark*I123456
port
3306
paths
/etc/my.cnf
service
systemctl enable mysqld
systemctl start mysqld
systemctl stop mysqld
redis 3.2.3
port
6379
paths
/etc/redis.conf
service
systemctl enable redis
systemctl start redis
systemctl stop redis
memcached 1.4.15
port
11211
service
systemctl enable memcached
systemctl start memcached
systemctl stop memcached