Apiato: URL : localhost instead of this default url

Created on 5 Aug 2017  路  2Comments  路  Source: apiato/apiato

simply i want to change the default url to default laravel url that is : localhost ,
because i cant go to next step so plz help me fast ,
And This is a great package indeed i hope i get the change to use it with its all functionalities
and is there any video tutorials or books about this framework , i really want to use it :)

Help

Most helpful comment

haha, sorry - i forgot to tell you about the VHost files ;)
I can only tell you for the XAMPP local dev server - but I assume it is quite the same if you are running a "real" Apache2 Server..

You need to look out for a httpd-vhosts.conf file (in XAMPP this file is located under INSTALLDIR/apache/conf/extra/httpd-vhosts.conf.

There you need to add the server-name as a known VHost (Virtual Host).
You can do this, by copying the respective block here:

<VirtualHost *:80>
    DocumentRoot "PATH/TO/YOUR/PROJECT/public"
    ServerName example.dev
    ServerAlias api.example.dev

    <Directory "PATH/TO/YOUR/PROJECT/public">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Because you have 3 subdomains (api.example.dev, admin.example.dev and www.example.dev) you need to copy/paste this block 3 times and change the SERVER ALIAS accordingly!

Be sure to point the path to the /public folder within your apiato project and don't forget to restart your server!
Cheers

All 2 comments

Hey man,

currently you need to define the following 2 keys in your .env file (if no .env file exist, just copy the .env.example and remove the .example part of the filename).

APP_URL=http://example.dev
API_URL=http://api.example.dev

You can choose whatever domain you like, as you need to manually define this domain to be "registered" to your own development machine. This can be done within the /etc/hosts file (on linux) or C:\Windows\System32\drivers\etc\hosts (on Windows - must be admin to apply changes to this file!)

Then add the following lines to the file:

127.0.0.1   api.example.dev
127.0.0.1   www.example.dev
127.0.0.1   admin.example.dev

and save the file and be sure to restart your Web Server!

Next, start your webbrowser and open www.example.dev and you should get redirected to your own machine ;)

haha, sorry - i forgot to tell you about the VHost files ;)
I can only tell you for the XAMPP local dev server - but I assume it is quite the same if you are running a "real" Apache2 Server..

You need to look out for a httpd-vhosts.conf file (in XAMPP this file is located under INSTALLDIR/apache/conf/extra/httpd-vhosts.conf.

There you need to add the server-name as a known VHost (Virtual Host).
You can do this, by copying the respective block here:

<VirtualHost *:80>
    DocumentRoot "PATH/TO/YOUR/PROJECT/public"
    ServerName example.dev
    ServerAlias api.example.dev

    <Directory "PATH/TO/YOUR/PROJECT/public">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Because you have 3 subdomains (api.example.dev, admin.example.dev and www.example.dev) you need to copy/paste this block 3 times and change the SERVER ALIAS accordingly!

Be sure to point the path to the /public folder within your apiato project and don't forget to restart your server!
Cheers

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rogerapras picture rogerapras  路  5Comments

ghost picture ghost  路  6Comments

Mahmoudz picture Mahmoudz  路  7Comments

phuocnt0612 picture phuocnt0612  路  3Comments

san4io picture san4io  路  7Comments