SmokeTM
49
62
Laravel

Set the document root correctly on centos 7

Posted 1 month ago by SmokeTM

I am struggling two days already to set the correct document root on apache. At first nothing worked I always got the error "Requested page not found", but right now I got it almost to work. The problem is in my url there is the project and public folder and I dont know why, because in my opinion I set it correctly in the apache httpd.conf.

Specifications

OS: Centos 7.3 WebServer: Apache Database: Msql 8 php: 7.2 Shared Hosting

Updated but app and public still in my url!

DocumentRoot "/var/www/html/laravel_app/public"

#
# Relax access to content within /var/www.
#
<Directory "/var/www/html/laravel_app/public">
    AllowOverride All
    # Allow open access:
    Require all granted
</Directory>

# Further relax access to the default document root:
<Directory "/var/www/html/laravel_app/public">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    #AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

I wanna get rid of laravel_app and public in my url. I really hope someone can help me its annoying...

Best

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.