Browserstack.com webtunnel not working - php

I'm using Browserstack.com local test and it seems not working for me.
I installed lampp on my Ubuntu 12.04 and configured httpd-vhosts.conf and /etc/hosts like below:
httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot "/home/ME/FOLDER"
ServerName dev
</VirtualHost>
/etc/hosts:
127.0.0.1 dev
I can access my PHP site on my local machine by typing dev/ in Chrome, but when using Browserstack's web tunnel for local test, it won't work after I input dev as HOST and 80 as PORT.
Does anyone know how to make things work? Thanks.

BrowserStack's web applet doesn't works with openjdk+icedtea-6-plugin combination. Is it possible for you to switch to sun/oracle java[1]?
[1] https://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-6-7-jre-or-jdk

well, just tried command line mode and it works. Following the official documentation, type this command java -jar BrowserStackTunnel.jar <MYKEY> dev,80,0, the dashboard page will prompt you it's OK to run local site automatically.
Perhaps a bug with web tunnel? I'm using open_jdk 1.6 and I installed icedtea-6-plugin for Chrome, don't know if it has anything to do with the version.
Anyway, command line is totally OK but I wonder if someone can help configure the web tunnel with me.

Related

Difference between Laravel local host and XAMPP local host address

I'm trying to learn Laravel, but ran into an issue I hope you can help resolve. Recently, while working to learn php programming I installed XAMPP, without problem and used it with both php and MYSql. It uses the localhost IP of http://127.0.0.1. In the new course I'm using to learn Laravel after the installation of Laravel the setup uses http://127.0.0.1:8000/, which I can access using Visual Code Terminal and entering "php artisan serve". Following the course instructions for setting up Visual Code I next installed an Extension titled "Connect to Server". After installation of the extension I get a dialog box to connect to the database and it defaults to the 127.0.0.1:8000/ address. If I click on the connect button I get an error. That said, if I start XAMPP and change the value in the dialog box and use the XAMPP 127.0.0.1 address I make a successful connection to MYSQL.The question I have is this, am I going to have a problem in the near future as the result of the two different 127.0.0... addresses and if so is there any way to resolve it?
If you look at the problem I have outlined the issue and hope I can get some resolution before I get to the point I run into trouble.
You can use php artisan serve if you wish to use the laravel's serve command. If you wish to use xampp/wamp, you can add a virtual host in your httpd-vhosts.conf file.
In case of wamp, httpd-vhosts.conf file is in C:\wamp64\bin\apache\apache2.4.51\conf\extra where 2.4.51 is the apache version if you did not change the installation path.
In case of xampp, it is C:\xampp\apache\conf\extra
As for the vhost setup, add the snippet below (change depending on your project path):
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host.example.com
DocumentRoot "path-to-project\public"
ServerName project.local
<Directory "path-to-project">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog "logs/project-errors.log"
CustomLog "logs/project-access.log" common
</VirtualHost>
Next is open your notepad as administrator then go to C:\Windows\System32\drivers\etc then open hosts file. add 127.0.0.1 project.local
restart wamp/xampp. You should be able to access your project using project.local
Xampp comes with Apcahe/ Mysql so when you run xampp it runs apache and mysql both.
but php artisan serve starts only a php server so your database related thins will not work if you are not running mysql separately (With xampp or as a standalone installation)
You can find more about what the artisan serve command to here PHP artisan serve code

Apache 2 start Wordpress instead of standard file

how to startup to wordpress instead of standard apache 2 file
I'm a complete noob when it comes to webdevelopment. I decided to find out how it worked a bit.
I created an apache 2 server on my raspberry pi model 3b plus. I installed a mysql database, and installed wordpress under /var/www/html/wordpress. I did it all according to this tutorial online. Only gave my database a different name and so on.
The only thing missing in the tutorial is how to now let my ipadress point to wordpress instead of index.html. My plan is to host a very simple wordpress site on my raspberry pi. And let my domainname point to the ip of the raspberry through a portforward on my router. So I need to start wordpress on the raspberry instead of the standard apache 2 files. Just to clarify extra: when I enter the Rpi adress into my browser now, it directs me to the "it works!" index.html file from apache2. I want it to go to the wordpress site I created when I enter the Rpi's ip adress. So I can go to my DNS host and let the domain name I own point to the outside IP adress of my router with a port, which I then redirect to the pi. I.E. host my own little website for fun.
I looked for the answer on the internet but couldn't really find an answer that explained this. The whole server thing, and hosting your own websites is still a bit vaque to me. As I said, never worked with it before. Any help will be appriciated.
There's a small mistake in the tutorial you followed.
To get things to work so hitting http://203.0.113.114/ where 203.0.113.114 is your machine's local IP address, you must install WordPress in your web server's root directory. The tutorial suggests you install it so you can hit http://203.0.113.114/wordpress to get it. That's not what you want.
The tutorial says to do this.
cp -R wordpress /var/www/html/
Instead you want to do this.
cp -R wordpress/* /var/www/html
That puts WordPress's files in /var/www/html/, not /var/www/html/wordpress/. After you do this, you should be able to say ls -al /var/www/html and see a bunch of files, including among others index.php.
Once you've done that, do the permission-changing stuff in your tutorial again. Then use your web browser to hit
https://10.11.12.13/
and you should get WordPress's setup wizard on your browser. Here are WordPress's own instructions.
Here's the thing to keep in mind: apache exposes a subset of your machine's file system to web browsers. That subset is rooted at the directory /var/www/html/. And also, when you have php installed, apache interprets files like foobar.php not as text, but as php programs. It runs them instead of just sending them to the browser. It's worth your trouble to wrap your brain around these concepts; they're the heart of web server technology.
Again, use your own IP address in place of 203.0.113.114.
You can create virtual host and access site from subdomain for example.
create host file
/etc/apache2/sites-available/wordpress.com.conf
enter
<VirtualHost *:80>
DocumentRoot "/var/www/html/wordpress/"
ServerName wp.localhost
</VirtualHost>
Then enable host with command sudo a2ensite wordpress.com
Then you should be able to access wordpress on subdomain wp.localhost / wp.{yourserveraddress}
Solved
I found the answer with both of the answers from O.jones and Koxo.
I created a new .conf file in /etc/apache2/sites-available called something.com.conf (just to test).
entered this bit of code in there:
<VirtualHost *:80>
DocumentRoot "/var/www/html/wordpress/"
ServerName something.com
</VirtualHost>
After that I did a2dissite 000-default.conf to turn the "old" config off. This is the config that directs you to index.html. Then I did a2ensite something.com which enables the website on the apache server. After that I did: sudo service apache2 restart to restart the service and everything worked.
Thank you O.Jones and Koxo for the help!

Failed to run Laravel 5 project on browser

I am very new to laravel, I am using windows 7 OS. I have a PHP website made on laravel 5 which I want to run on my browser. I have gone through the videos and the various website on "How to run laravel 5 project on browser" but unfortunately I failed to run my project on the browser.
I am using XAMPP and below is my Virtual Hosts file of apache. My localhost port is 7000.
<VirtualHost *:7000>
DocumentRoot "C:\xampp2\htdocs\basicwebsite\public"
ServerName basicwebsite.com
</VirtualHost>
And inside the hosts file within the system32 folder I have put the following line
127.0.0.1 basicwebsite.com
When I am trying to run it on my browser it gives me an error
"This site can’t be reached
basciwebsite.com refused to connect."
Any help is welcome.
When I'm developing locally with Laravel, I simply execute php artisan serve on the terminal. I can then run it on http://localhost:8000
check below points -
1.) .env file should have APP_KEY
2.) have you created "storage/views" , "storage/cache"
Try This:
<VirtualHost *:7000>
DocumentRoot "C:/xampp2/htdocs/basicwebsite/public"
ServerName basicwebsite.com
<Directory "C:/xampp2/htdocs/basicwebsite">
</Directory>
</VirtualHost>
Try using something other than basicwebsite.com in the servername,
Maybe use basicwebsite.local
Explanation:
.com is widely used therefore using something different should do the trick, try http://nameofwebsite.local
(doesn't have to be .local, can be anything really but not .com or .net for example)

How to change apache domain name(locally) for a laravel site on ubuntu?

Good day guys in my application I want to change the normal http://127.0.0.1:8000/ that laravel uses to serve sites when one runs php artisan serve to example.com and this should have sub domains like app1.example.com and app2.example.com.
In the main time I have tried to create a virtual host for my site by creating a .conf file inside of etc/apache2/sites-available/example.com.conf and here is how it looks:
<VirtualHost *:80>
ServerAdmin webmaster#example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /home/tangaye/sites/example/public/index.php
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
After doing that I enable the virtual host I created by running sudo a2ensite example.com.conf and sudo service apache2 reload to reload apache2 configuartions and sudo service apachIe2 restart from the on I added the address my site points to in /etc/hosts:
127.0.0.1 localhost example.com
127.0.1.1 tangaye
After doing all this when I run php artisan serve from my laravel site directory I still see my site being launch like this:
Laravel development server started: http://127.0.0.1:8000
After all I have done I expected to rather see this:
Laravel development server started: example.com
The worst thing is when I try to access example.com in my browser it tends to search for it on the internet.
At this point I don't really understand what really I'm doing. All I want is to be able to customize my site domain name LOCALLY and add other sub domains.
Will appreciate any help. Thanks!
You can't specify port numbers in /etc/hosts. There's no way to get around that part.
You should be able to just throw example.com after the localhost definition:
127.0.0.1 localhost example.com
and then it will also resolve to 127.0.0.1 ... then it's just a matter of name-based hosting configurations in Apache. Your file looks pretty good, but DocumentRoot is specifying a folder, not a file. Remember to do an a2ensite to enable your site (it's really just creating a symlink in sites-enabled pointing at the sites-available file) and restart Apache.
To avoid your browser interpreting a web address as a search term, you can prefix it with http://
Note that PHP's built-in development server and Apache are two completely separate ways to serve a PHP webpage/app.
php artisan serve is a rapid development tool, allowing for easy access to a PHP project without the need to set up a full-fledged web server (e.g. Apache). All you need is PHP and you can run Laravel or other PHP projects. (It's also important to note that this should be used for development only, never in production.)
Apache, on the other hand, is a full-featured web server, with all the bells and whistles, including virtual host management. And it works over port 80, so no need to add the port to your URLs.
If you want to use a named URL in your development environment, you should:
Install Apache
Configure Apache, including virtual hosts and PHP configuration.
Modify your hosts file to point your chosen development domain name to your local machine (or the machine serving your app, which could be a Vagrant box, Docker, etc. if you choose to use such tools).
Don't bother using php artisan serve at all.

wamp localhost not working (I know there are few posts but mine is quite weird)

Ok, let me try to shorten things so less to read.
wamp works fine for the past few months, then I started to learn laravel4 and optionally requires vhost and rewrite_module which works pretty well that when I type in larave.intro as URL it works.
Now I'm trying to use wamp again just going to localhost AND page says
The title of the page does say 404 Not Found.
Read a few threads, some said go apache->service->Test port 80 and see if there are other ports running port 80. It says
Your port 80 is actually used by : Server: Apache/2.4.4 (Win32) PHP/5.4.16
which means my apache is the only one running it isn't it...
this already makes me curious and feeling weird, well alright then I go change my port or 8000 in the httpd.conf restart my wamp. and uses localhost:8000 alright now wamp works and I test port 80 again it says
Your port 80 is actually not used.
So nothing is running on my port 80 why can't wamp use it?
And, at first I thought it's my vhost so I deleted the vhost and in my host I deleted 127.0.0.1 laravel.intro too and runs my wamp back to port 80...still doesn't work.
I was thinking then fine I will just use port 8000 BUT then my vhost won't work :(
I was using this as my vhost before
<VirtualHost *:80>
DocumentRoot "J:\wamp\www\laravel4-basic\public"
<Directory "J:\wamp\www\laravel4-basic\public">
Options FollowSymLinks Indexes MultiViews
AllowOverride All
</Directory>
ServerName laravel.intro
</VirtualHost>
and in host it's 127.0.0.1 laravel.intro
now since I'm using port 8000 I suppose I should change the vhost too? so I changed to
<VirtualHost *:8000>
and laravel.intro doesn't work. laravel.intro works if I'm using port 80 with virtualhost: *80 and in URL if I type 127.0.0.1:8000 what popped up is laravel.intro instead of the wamp index and if I use localhost:8000 wamp index comes out.
I'm pretty much so confused now.
Side note:php Admin works fine if I'm using port 80 and in URL I just go localhost/phpmyadmin
Anyone knows what I'm talking about here? I'm getting confused a bit myself at the end and anyone can get me back to port 80 with everything works?
(if I have to change port then oh wells better than one works and the other one doesn't)
Please give me some suggestions thanks ~!
completely remove the wamp files and just clean the temp files and www folder where you have installed and restart the system and then reinstall WAMP and run
The error message means apache is running, so this is a good thing.
By specifying the local host url you are requesting a file called index.htm, index.html or index.php (any one of them depending on your configuration), and the error is merely telling you that the file is not there.
Check that one of these files are in the directory : J:\wamp\www\laravel4-basic\public
If you do that and the problem persists, look for the *error_log in the WAMP log directory. The 404 error message means a file is missing. The error log will tell you which file it is looking for that is missing.
I'm using Laravel 4.1 installed in a Windows OS System with WAMP Server and I get it working using the following routine:
To avoid the conflict between localhost and your virtualhost project you can config as follow:
In the httpd.conf remove the # from the following line:
#Include conf/extra/httpd-vhosts.conf
to
Include conf/extra/httpd-vhosts.conf
Later you need to modify your httpd-vhosts.conf file from c:/wamp/bin/apacheX.X.X/conf/extra folder (i'm using Windows 8 OS). Here you need to add the following VirtualHosts:
#Localhost
<VirtualHost localhost:80>
ServerName localhost
DocumentRoot "c:/wamp/www/"
</VirtualHost>
#My VirtualHost
<VirtualHost appdomain.dev:80>
ServerName appdomain.dev
DocumentRoot "c:/wamp/www/app/public"
</VirtualHost>
In this virtualhost app is the project folder and appdomain.dev is the host that I specify in the hosts windows file located in c:/windows/system32/drivers/etc/hosts:
127.0.0.1 appdomain.dev
As you can see it needs two VirtualHosts because if you use only the second VirtualHost you overwrite the localhost access, then you need to specify the Localhost access as a new top virtualhost.
I hope it serves you.
This problem happen cause of port 8000 has been reserved so try to change it by the following :
In your command line prompt try :
php artisan serve --port=8080
Go to your browser with : localhost:8080
by that it works with me.

Categories