Hello Oninstack

初始环境

  • yum -y install gcc automake autoconf libtool make wget screen gcc gcc-c++ zlib-devel pcre-devel openssl-devel
  • 下载

安装

  • ./install
    选择mysql5.6 php5.6

    ####################Congratulations########################
    
    Nginx/Tengine install dir:      /usr/local/nginx
    
    Database install dir:           /usr/local/mysql
    Database data dir:              /data/mysql
    Database user:                  root
    Database password:              xxxxxx
    
    PHP install dir:                /usr/local/php
    Opcache Control Panel url:      http://192.168.134.141/ocp.php
    
    Pure-FTPd install dir:          /usr/local/pureftpd
    Create FTP virtual script:      ./pureftpd_vhost.sh
    
    phpMyAdmin dir:                 /data/wwwroot/default/phpMyAdmin
    phpMyAdmin Control Panel url:   http://192.168.134.141/phpMyAdmin
    
    redis install dir:              /usr/local/redis
    
    memcached install dir:          /usr/local/memcached
    
    index url:                      http://192.168.134.141/
    
    Please restart the server and see if the services start up fine.
    Do you want to restart OS ? [y/n]: 
    
  • # nginx -V#看看nginx的编译参数

    nginx version: nginx/1.9.6
    built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) 
    built with OpenSSL 1.0.1e-fips 11 Feb 2013
    TLS SNI support enabled
    configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-ld-opt='-ljemalloc'
    

运行

  • 设置防火墙允许80端口

    # vim /etc/sysconfig/iptables
    添加一行
    -A INPUT –m state –-state NEW –m tcp –p tcp –-dport 80 –j ACCEPT
    然后保存并退出:wq

  • 运行/etc/init.d/nginx start在oneinstack也可以# service nginx start
  • Nginx的命令以及配置文件位置:

    • /etc/init.d/nginx start # 启动Nginx服务
    • /etc/init.d/nginx stop # 停止Nginx服务或/usr/local/nginx/sbin/nginx -s stop
    • /etc/nginx/nginx.conf # Nginx配置文件位置

vbox nat网ssh连接

  • 设置nat 的 forward port
    Host port 3022, guest port 22, name ssh, guest ip:10.0.2.4
  • ssh://root:******@127.0.0.1:3022

vbox nat网http访问vhost

  • 设置nat 的 forward port
    Host port 3080, guest port 80, name www, guest ip:10.0.2.4
  • http://localhost:3080/

./vhost添加vhost

  • server_name catuncle.wang unclecat.wang;
  • 通过ftp工具上传hello.php文件到/root/wwwroot/catuncle.wang
  • 宿主机访问catuncle.wang:3080/hello.phpunclecat.wang:3080/hello.php

其它

  • List Network Interfaces Using ip Command
    # ip link show
  • # ls -d /sys/class/net/eth*查看网卡(ifconfig没有显示的也会在这里)
  • 添加网卡

    • # cp /etc/sysconfig/network-scripts/ifcfg-eth0 cp /etc/sysconfig/network-scripts/ifcfg-eth1
    • 修改ifcfg-eth1

      DEVICE=eth1
      HWADDR=08:00:27:9b:4b:44#`cat /sys/class/net/eth1/address`
      UUID=dabbcefa-bbbe-4779-b0b8-0eaf9df981fc#由`uuidgen eth1`产生
      
    • # service network restart
  • netstat -lpn|grep :80#查看谁在监听80端口
  • rpm -qa |grep openssl#查看是否有安装openssl

你可能感兴趣的:(建站)