Mint Linux で Apache 仮想ホストをセットアップしようとしています。それはちょっと動作しますが、一部の画像は利用できません。たとえばhttp://test.local/icons/world.pngは、画像が存在する場合でも 404 を返します。ログを確認すると、DocumentRoot を /var/www/test.local/public_html に設定しても、/usr/share/apache2/icons/world.pngで画像を探していると表示されます
これが私がこれをした方法です。/etc/apache2/sites-available/default を test.local にコピーし、次のように編集します。
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName test.local
DocumentRoot /var/www/test.local/public_html
<Directory /var/www/test.local/public_html/>
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
次に、/etc/hosts を編集して127.0.0.1 test.localを含めます。a2ensite test.localを実行し、apache を再起動します。
私がやろうとしているのは、/var/www/test.local/public_html のフォルダーをhttp://test.localにマップすることです。不足しているもの、またはこれを行う簡単な方法があります。
また、プロジェクトのルート ディレクトリまたはアイコン ディレクトリには .htaccess ファイルがありません。