My problem is configure a virtual host for an web application with php and Xampp. The principal application, named "AEPAMG.upo.es" is working, but when I add "Viafirma-client-php" as other app and another virtual host, browser say me "Not found". I include some pictures where you can see the configurations:
Related
I was create PHP project on my local server.
And then config to run via virtual host
e.g project.local
after site is config and enable...
Linux chrome call -> project.local (work)
Android emulator chrome ? 10.0.2.2/project (not work) || project.local (not work)
How to call project.local from android emulator?
Symfony project is not running on a remote virtual host because there is no index.php file in the project root directory. When I'm trying to open my symfony project on a localhost with
URL "localhost/symf.com"
it only shows me project folders instead of the home controller. I know I should open my site with Php bin/console server:start command, but how does it work on a remote virtual host?
Perhaps I should somehow change my project's root directory? But I don't have access to remote virtual host configuration
In virtual host you must run prod environment not dev as your localhost. So you must configure your Apache configuration to run your project. Use following link:
Web Server Configuration for Symfony
Be careful, in symfony 3.4 the DocumentRoot is equal to project_path/web and in symfony 4.3 is equal to project_path/public
You mentioned that you do not have access to your virtual host to set one by one configuration. In that case the best way is using docker-compose, so with running docker-compose up -d all the things you need to run your project will be generated automatically. But you must have enough knowledge about docker
Be successful.
Symfony's homepage in at 'YourProject/public/index.php'.
You have to point on this file to see your home controller.
I have developed a MVC project with Laravel 5.4. Whenever I want to develop it on localhost, I use php artisan serve command to access it via localhost:8000 on browser. Now I have uploaded the project on a linux server with centos 6 and I run php artisan serve --host 0.0.0.0 --port 8080 to access it via x.x.x.x:8080 on browser but it is a temporary way to access project from browser. What is the permanent way to access a laravel project by clients via public IP?
I have apache,php and ... separately installed on my server. I can not see x.x.x.x/projectname/public or x.x.x.x/projectname. The project is in /var/www/html directory.
You can access the laravel project with yoursite.com/projectname/public if you upload your project on web root.
If you want to access it directly with yoursite.com you need to map the public folder in your virtual host configuration.
# The location of our projects public directory.
DocumentRoot /path/to/your/public
On your linux server install the LAMP or XAMP that include the apache server and Mysql and some other related tools into it. Upload the code on web root. Now try to access it with the IP or the domain name like:
XXX.XXX.XXX.XXX/projectname/public
or
or domain/projectname/public
Note: You can remove that public by making a symlink to the public directory or by making a virtual host entry.
Here are the steps you need to do [assuming you are using apache, but its not very different for nginx]:
install PHP, MySQL and apache in your server
place your project in /var/www/ folder
give permission to storage folder of your project chmod -R 777 your/project/storage
edit /etc/apache2/sites-available/000-default.conf file e.g. DocumentRoot /path/to/your/public
restart apache
Please check other answers. They are very good and give you a clear starting point. Just do little research and you will get it.
I've installed EasyPHP and Virtual Host Manager - got it up and running, created a virtual host, pointed it to the directory to where i have my website stored. It's on the D Drive however when i click on the virtual host that i've created it points to a directory inside where the installation took place for EasyPHP as shown below;
Browsing the localhost development URL shows this;
So the only way i got it working was to dump the site folder inside the projects folder and it worked. Strange. Anyone know how i can get it to load from the virtual host URL and directory?
When XAMPP is installed, we can open file using URL like localhost/home.php. Can we open the very same file like (for example) using an URL like hamzazafeer.com/home.php or www.hamzazafeer.com/home.php? Is there any way or we can't change this address?
You can override the domain target to localhost. That means that your browser "thinks" that the domain is on localhost. The browser will fetch then the local files instead of calling a remote server. To do that you have to edit in C:\Windows\System32\drivers\etc a file named hosts. Depending on your operating system and settings it could be a little hard to edit the file. But you will find further specific information with the help google.
The row you have to add into this file will look like:
127.0.0.1 hamzazafeer.com
Yes and no.
Yes, you can. In default XAMPP installation, it always points to some default folder (htdocs folder in its root folder under Windows, /var/www under Linux etc.) This answer may help you locating this folder in your installation of XAMPP).
You can install (FTP copy) XAMPP on any hosting, where your domain hamzazafeer.com currently points to, and properly configure it (both hosting and domain) to point to your XAMPP's default websites folder and you're ready to go.
(BTW: You're mixing certain things. XAMPP nothing to do with this, it is Apache's configuration variable plus XAMPP / Apache has nothing to do with this in general -- you can point your domain to any folder on any hosting, no matter, what server software is used to serve your website)
No, you shouldn't. XAMPP is from the begining to the very end designed as localhost, test-purpose-only, developer-only solution. You should ever, never use it for serving production version your websites or anywhere on any publicly-accessible hosting. Limit it only to your localhost, as it was meant by XAMPP's creators.