4
4

More than 5 years have passed since last update.

テストサーバー用のアカウント作成方法

Last updated at Posted at 2012-12-26

1.サーバーログイン後、スーパーユーザーに。

su -

2.HTMLデータを格納するフォルダを作成

cd /var/www/html/
mkdir "フォルダ名"
cd "作成したフォルダ名"
mkdir htdocs

3.シェルが使えず、ホームディレクトリが /var/www/html/hoge のユーザー[hoge]を作る方法。警告がでるが次に進む

adduser --shell /sbin/nologin --home /var/www/html/hoge/ hoge

4.パスワードを設定

passwd hoge

5.ユーザーを記載する

vi /etc/vsftpd/user_list

6.上位ディレクトリにアクセス許可するユーザを/etc/vsftpd/chroot_listに設定しますどのユーザーにも許可させないので、そのまま保存して、空のファイルを作ります。

vi /etc/vsftpd/chroot_list

7.vsftpdを再起動

/etc/rc.d/init.d/vsftpd restart

8.バーチャルホストの設定

vi /etc/httpd/conf/httpd.conf
httpd.conf
<VirtualHost "ipアドレス":80>
    ServerAdmin メールアドレス
    DocumentRoot /var/www/html/homefolder/htdocs
    ServerName domain.com
    ErrorLog domain.com-error_log
        ServerName domain.com
    ErrorLog domain.com-error_log
    CustomLog domain.com-access_log common
</VirtualHost>

9.httpdを再起動

/etc/rc.d/init.d/httpd restart
4
4
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
4
4