類似の投稿がたくさんありますが、3時間のリサーチの後に解決策が見つかりません。誰かが助けることを願っています。使用Laravelがサブフォルダにインストールされていますが、ホームページに表示されます。
技術:
- のApache/2.4.7(Ubuntuの)
- Laravel 5.4
- PHP 7.0
は/ etc/apache2の/サイト対応/ 000-デフォルト。 conf
<VirtualHost *:80>
ServerAdmin [email protected]
Servername example.com
DocumentRoot /var/www/html/example.com
<Directory />
Options +FollowSymLinks
#AllowOverride None
Require all granted
</Directory>
<Directory /var/www/html/example.com/>
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory "/var/www/html/example.com/parcgilley/public">
Options Includes Indexes FollowSymLinks
DirectoryIndex index.php
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
.......
文書ルートは/var/www/html/example.com、私のlaravelサイトは/var/www/html/example.com/parcgilleyにあります。私はサイトを/var/www/html/example.com/parcgilley/publicに向けるように000-default.confを設定しようとしましたが、example.com/parcgilleyに行くと "Index of/parcgilley"と表示されます。 http://www.example.com/parcgilley/public/に移動すると、「このページは機能していません」と表示されます。
これは私のパブリック/ .htaccessファイルである:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
これは、オリジナルのコンテンツではありません。私はLaravelの指示に従っていたので、私は上記のコードで原点を置き換えました。
また、私は/ parcgilleyプロジェクトのルートフォルダとストレージフォルダのアクセス許可を設定しましたが、無駄にしています。
/publicフォルダを指すように.htaccessファイルを作成する必要があるかどうかわかりません。しかし、私はApacheの設定についてあまり知らない。
洞察力があれば幸いです。編集
:
はまた、私は/var/repo/site.gitで裸のレポの立地で、サーバーに自分のローカルマシンからウェブサイトをプッシュするSSHやGitリポジトリを使用しました。それが問題に関連するかどうかはわかりません。