Laravel Dusk: The correct localhost port for APP_URL on a remote server? - laravel-dusk

I am trying to install Dusk on Laravel at a REMOTE host and at some point I need to change the .env file like this
APP_URL=http://localhost:8000
Another tutorial suggested something like
APP_URL=http://localhost:9515
For a remote host, do I need to put "http://localhost:????" and if I need how do I find the port number? I not do I just leave it as "/"?
By the way, I have tested several options and non have worked so far so but I am not sure what causes it so I am trying to pint point the problem.

Set the APP_URL to the same URL you are using in the browser for your local development environment. This can be http://localhost but also a custom URL:
APP_URL=http://dusk.local
For Laravel Homestead you can manage your sites within your Homestead.yaml file.
The APP_URL is somehow important as commands from the terminal require this information as pointed out in detail in this answer.
The port 9515 is the default port number of the Selenium server URL as provided in DuskTestCase.php. There's no need to change it at the beginning as it should work out of the box.
By default, the ports are forwarded to your Homestead environment.

Related

Mod wsgi and apache configuration

I'm facing the following issue: i've a public web server running on a given URL, say, www.mysite.com.
It uses apache2.
I've developed a python web app and I want to make it publicly accessible.
Locally, I use the command
mod_wsgi-express start-server wsgi.py
to start the server and everything works.
However, I would like to link only a specific URL to my app, such as mysite/my_test, leaving apache2 serving all the other requests.
In other words, I would like to set the server URL for mod_wsgi-express to mysite/my_test port 80.
By default I get Server URL: http://localhost:8000, and I would like to change this.
I've tried the --mount-point option, but I didn't see any difference.
I know I can change the apache configuration and adding WSGIScriptAlias but I'm facing multiple issues, so I'm searching for a quickest and easiest way.
Hope this is clear.
Thanks.

Use Windows 2016 server with Xampp to host more than 1 website

I have tried all kinds of things, read all answers, and configured the bananas out of it, but I cannot seem to get the following working:
A windows 2016 server with XAMPP, to host more websites than 1.
What have I done:
I have altered the httpd-vhosts.conf as described all over the web with allowing NameVirtualHost, and setting up virtual host with documentroot, servername etc.
I have pointed a domain with the a-record to this server
installed the latest XAMPP release to date
changed the windows hosts file, as described everywhere (127.0.0.1 domainname.com)
What works:
I can get the domain working on my server's browser. When I enter the specific domainname.com it shows the hello world page I made in the specified folder. The domain resolves and shows the page that is in de directory accordingly
Besides that, the localhost of apache is also working, I have 2 sites working, but only on the browser of the server, on the machine itself.
What does not work:
Only 1 thing. when I want to access the domain from any other machine than the server (from outside so to say), it will not work, but when I ping the domain on my home-pc it resolves to the server.
I am at a loss. Been at this for hours, and beginning to question if it is even possible.
Can anyone tell me what I am doing wrong here, or if it is even possible to have more than 1 website to work on XAMPP and resolve form the outside?
Thank you in advance.
It was windows firewall that stopped all inbound connections. I finally figured it out!

Apache2 Not Responding: Bitnami Magento Install (Legacy)

For reasons too insane to even go into, I am attempting to install using the Bitnami Magento 1.9.2.4 image on a fresh Amazon AWS/Lightsail Ubuntu 16.04 instance (2gbs to avoid complaints and be sure I don't run into anything unnecessary).
I think this is really more of an Apache question. After I finish the install (success), I can't get the server to respond via the instance IP address at the default port (8080).
Regarding the old Bitnami Image, you can get (or wget) that Magento 1.9.2.4 image still, it's over here:
wget "https://downloads.bitnami.com/files/stacks/magento/1.9.2.4-3/bitnami-magento-1.9.2.4-3-linux-x64-installer.run"
So for the sake of anyone who's trying to work through the whole process, once you pull the above down to your instance you need to chmod the above file to 755. This assumes you are in the directory with your download:
chmod 755 bitnami-magento-1.9.2.4-3-linux-x64-installer.run
Then run it using it's full path, like:
/home/ubuntu/bitnami-magento-1.9.2.4-3-linux-x64-installer.run
So the install is going to ask a bunch of questions, for anyone keeping track my answers were all yes (ie. yes to Git, PhpMyAdmin, Beetailer... whatever that is).
Then I created an admin user / password etc.
As far as the port I didn't have anything running on 8080 so the install defaulted the port to 8080 with HTTPS on 8443 with MySQL on 3306 (more on ports in a minute).
I think Host/Domain is one of the keys to this problem. When I couldn't get the server to respond I just recreated an instance and tried a different Domain during the install process. I tried: internal AWS IP, External ACTUAL IP, 127.0.0.1
Here's what the Magento 1.9 Domain prompt looks like:
So basically that sort of brings us up to date.
Once I finished the install, like a normal human used to using bitnami as a cloud image I assumed the server would respond at whatever the default path was at the IP address it was running on. Ie:
BASEIPADDRESS:8080/magento
Not the case. When I hit that the server does NOT respond, hence the question. In addition to the above I have also tried the BASEIPADDRESS, and the BASEIPADDRESS:8080
Results checking open ports
So since the server is not responding I figured I would check the ports.
First I checked using netstat:
netstat -lntu
I got back:
Then I realized that netstat is now depreciated... so I went with:
ss -lntu
I got back:
(excuse the images, formatting wouldn't work for text)
To me it looks like 8080 (default) is open in both of those results. So why isn't the server responding at the default location?
#Bitnami Status = OK
Checking the status with:
/home/ubuntu/magento-1.9.2.4-3/ctlscript.sh status
Everything looks good:
apache already running
mysql already running
Memcached not running
Since it says Memcached was not running, I started memcached to see if that was the issue, no it was not.
I can access the instance via SSH and yes I am sure the IP is right. See images above.
I also posted this to the Bitnami community but haven't heard anything over there. Will cross populate as I get ideas.
It looks to me that you configured Magento using the private IP address, so you would not be able to access from your browser. A way to check it is by executing the following command in your machine:
curl -L 127.0.0.1:8080/magento
If that provides output, then the IP is misconfigured, so you would need to reinstall using the proper IP
So this ended up being PRIMARILY due to not running the Bitnami stack installer as root / sudo:
sudo /home/ubuntu/bitnami-magento-1.9.2.4-3-linux-x64-installer.run
Why Install with Sudo on AWS/Lightsail?
So the reason you need to install as sudo has to do with the fact that when run as the normal user (ie. not root) the installer defaults to port 8080 which is NOT open on aws by default. To complicate matters further you may not be able to get things running properly even if you manually swap to port 80 AFTER you run the installer.
To avoid a scenario where port 80 requires root access to utilize I just re-created my instance and ran the installer as root with the above command.
Host Setting
During install I selected the public IP for the "Host" prompt and everything worked as I thought it might (straight out of the box).
Thanks to Javier Salermon who put me on the right track and the devs at Bitnami for cueing me into the fact that 8080 is not open by default.

How to test SSL is set up and configured correctly on dev?

I am moving a site from one server to a new server. Currently the new server is the development site and is accessed via IP.
I have copied and set up the SSL on the new server but there doesn't seem to be anyway of testing that the SSL is properly installed until I point the domain.
Is there a way I can test that the SSL it setup and configured correctly before I point the domain?
Ideally I'd like to launch the site and know that everything is working correctly!
Thanks
You could try adding the new IP address for the host to your /etc/hosts (or wherever Windows stores the hosts file; look in C:\Windows\System32\hosts as a starting point) file on your client. It's just like updating DNS for a single machine.
Don't forget to remove the entry after you're done testing.
When you set up that entry in the hosts file it should have the form:
"IP address of dev server" "olddomain.com"
and when you remove the entry you can simply comment it out with a "#" at the beginning of the line

My Apache setup alongside IIS

I am trying to learn PHP. I am having trouble getting Apache working correctly on my Vista Home Premium machine.
I have IIS7 running and I would like to have Apache running along with it. I was looking around on the web and some say that it would be fine having the two together as long as they are looking at different ports.
I left IIS looking listening on port 80 and I edited the httpd.conf file in the apache2triad/conf folder to listen on port 8080 and changed the server name to localhost:8080. When I go to localhost:8080/phpmyadmin the page that allows me to create a database looks like all the page styling is off so I know that something is already wonky.
I enter a database name and click the Create button, then receive a 404 error from IIS. It says that it is looking for a file at:
Requested URL:
http://localhost:80/phpmyadmin/db_create.php
Physical Path:
C:\inetpub\wwwroot\phpmyadmin\db_create.php
It's pointing to my inetpub folder but all of my PHP stuff is in the c:\apache2triad folder.
Can someone please tell me what I am doing wrong? Thanks.
If you want to get a URL from your Apache server, you need to use port 8080 instead of port 80 (which is where you say IIS is running) - so your URL should be http://localhost:8080/phpmyadmin/db_create.php
As Shawn said, if you're not familiar with apache at all, you're probably better off setting up PHP under IIS - see http://www.php.net/install.windows