Ubuntu 23.04 Apache2 ユーザーのホーム領域を有効にするサンプル

環境
Ubuntu 23.04
Apache2

操作方法
1.userdir モジュールを有効にします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# a2enmod userdir
# a2enmod userdir
# a2enmod userdir

2.apache2を再起動します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# systemctl restart apache2
# systemctl restart apache2
# systemctl restart apache2

3.任意の一般ユーザーでテストページを作成します。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ mkdir ~/public_html
$ chmod 711 $HOME
$ chmod 755 ~/public_html
$ vi ~/public_html/index.html
$ mkdir ~/public_html $ chmod 711 $HOME $ chmod 755 ~/public_html $ vi ~/public_html/index.html
$ mkdir ~/public_html
$ chmod 711 $HOME
$ chmod 755 ~/public_html
$ vi ~/public_html/index.html

下記コードを追記します。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<html>
<body>
<div>
Test Page 12345
</div>
</body>
</html>
<html> <body> <div> Test Page 12345 </div> </body> </html>
<html>
<body>
<div>
   Test Page 12345
</div>
</body>
</html>

 

Ubuntu 23.04

Posted by arkgame