LoginSignup
0
0

More than 5 years have passed since last update.

Ubuntu 16.04.5 LTS の virtualhostの設定 + php + postgresql + laravel メモ

Last updated at Posted at 2018-08-29

root@ubuntu adduser ubuntu
root@ubuntu sudo passwd ubuntu
root@ubuntu gpasswd -a ubuntu sudo

local@mac ssh-keygen -t rsa -f ./id_rsa
ubuntu@ubuntu mkdir ~/.ssh
local@mac scp ~/id_rsa.pnb IPアドレス:~/.ssh
ubuntu@ubuntu sh-add ~/.ssh/authorized_keys
ubuntu@ubuntu cat ~/id_rsa.pub >> ~/authorized_keys
ubuntu@ubuntu chmod 600 authorized_keys 
ubuntu@ubuntu chmod 700 .ssh/
local@mac ssh -i ~/id_rsa ubuntu@IPアドレス

root@ubuntu vim /etc/ssh/sshd_config

PermitRootLogin yes を PermitRootLogin no に修正する

root@ubuntu /etc/init.d/sshd restart

ubuntu@ubuntu mkdir /home/ubuntu/public_html

ubuntu@ubuntu chmod -R 755 /home/ubuntu/public_html

root@ubuntu vim /etc/apache2/sites-available/virtual.host.conf

<VirtualHost *:80>
    ServerName www.virtual.host
    ServerAdmin webmaster@virtual.host
    DocumentRoot /home/ubuntu/public_html
    ErrorLog /var/log/apache2/virtual.host.error.log
    CustomLog /var/log/apache2/virtual.host.access.log combined
    LogLevel warn
    <Directory "/home/ubuntu/public_html">
       Require all granted
    </Directory>
</VirtualHost>

root@ubuntu a2ensite virtual.host

root@ubuntu /etc/init.d/apache2 restart

ubuntu@ubuntu vim /home/ubuntu/public_html/index.html
root@ubuntu sudo add-apt-repository ppa:ondrej/php
root@ubuntu sudo apt-get update

root@ubuntu sudo apt-get install php7.2

root@ubuntu sudo apt-get -y install postgresql

root@ubuntu sudo apt-get -y install php7.2-common php7.2-cli php7.2-fpm hp7.2-dev php7.2-mbstring php7.2-zip php7.2-curl php7.2-gd php7.2-pgsql php7.2-xmlrpc php7.2-intl

root@ubuntu sudo apt-get -y install curl git unzip
ubuntu@ubuntu cd ~
ubuntu@ubuntu curl -sS https://getcomposer.org/installer -o composer-setup.php
ubuntu@ubuntu HASH=544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061
ubuntu@ubuntu php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
→Installer verifiedと表示される。
root@ubuntu sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

ubuntu@ubuntu composer create-project --prefer-dist laravel/laravel app
root@ubuntu sudo apt-get -y install nodejs
root@ubuntu sudo apt-get -y install npm
ubuntu@ubuntu npm install

参考URL https://qiita.com/kpkpkp/items/30abe1a68a3a4e8881ab

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0