私は最近、AWS ec2 ubuntu instance
にウェブサイトをホストしました。私のディレクトリ構造は2つのフォルダで構成されています。デフォルトのドキュメントルートを変更した後にバックエンドにアクセスできない
back (consists of laravel 5.2)
front (consists of index.html,css and javascript files)
私はバックエンドにlaravelを使用しています。私のウェブサイトにアクセスしているときはいつも、 www.abc.com私はデフォルトのubuntuページを取得しています。だから、私は手動でwww.abc.com/front/index.htmlに行く必要がありました。この問題を回避するため、/etc/apache2/sites-available/000-default.conf
のDocument root
を/var/www/html
から/var/www/html/front
に変更しました。 1つのことを除いてすべて正常に動作します - 私はリンクwww.abc.com/back/public
を使ってバックフォルダにアクセスすることができません。 私は現在、www.abc.com/ のフロント/back/publicにアクセスしていると思います。 今何をすべきか?
000-は、default.conf:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/html/front
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
シェアの内側にこれらを入れて、あなたのapacheは、default.conf CONTENS – msonowal
@msonowal私はdefault.confを追加しました – uttejh
あなたは仮想ホストを作る必要があります:h ttps://httpd.apache.org/docs/2.4/vhosts/examples.html – Hammerbot