NOT FOUND http://localhost/~username/ - macos

I'm having the following problem when i try to access my projects on localhost from the Sites dir
Not Found
The requested localhost/~barrymcmahon/php_5_advanced/ was not found on this server.
I know apache is working because I get a response from localhost [It Works!] and I can curl it with headers using [curl --head localhost] and I get a 200 but when I try to use the projects in my sites folder I get the above error.
I have amended the httpd.conf file and the user/username.conf file to point to the correct dir.
I noticed this is in the browser header when i get the 404 [ dont know if it will help ]
Remote Address:[::1]:80
Is is possible that there is there a different format for the localhost path on yosemite os ?

Related

Codeigniter 4.0.4 redirecting to 404 - File Not Found

Why I got 404 - File Not Found when I run CI.
I am using xampp 8.0.0, I already put my CI folder to htdocs and also I've changed the config/app baseurl to http://localhost/framework-4.0.4/.
When I open it to browswer and click public it just redirected to 404.
enter image description here
You should setup a virtual host in your xampp for your project.
To do that for this codeigniter projects, open the the Apache httpd-vhosts.conf file which are located in C:\xampp\apache\conf\extra\httpd-vhosts.conf, Added below lines of code at the end of the file.
using the example codeigniter-blog.local
DocumentRoot "C:/xampp/htdocs/framework-4.0.4/public"
ServerName codeigniter-blog.local
Now, Open the hosts file which are located at C:\Windows\System32\drivers\etc\hosts, Added below code into this file at the end.
127.0.0.1 codeigniter-blog.local
restart the xampp server.
If you open the browser and navigate http://codeigniter-blog.local, if you are getting welcome page, that means everything fine otherwise you'll get intl package is not enabled.

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

GuzzleHttp\Exception\RequestException
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
how to solve this error i am trying everything available on the google including
the below description several times
Download this file: http://curl.haxx.se/ca/cacert.pem
Place this file in the C:\wamp64\bin\php\php7.1.9 folder
Open php.iniand find this line:
;curl.cainfo
Change it to:
curl.cainfo = "C:\wamp64\bin\php\php7.1.9\cacert.pem"
But still it didn't work for me
please help me i am so frustrated right now...
You need to put .pem file inside of C:\wamp64\bin\php\php7.1.9\extras\ssl instead of C:\wamp64\bin\php\php7.1.9
Make sure the file mod_ssl.so is inside of C:\wamp64\bin\apache\apache(version)\modules
Enable mod_ssl in httpd.conf inside of Apache directory C:\wamp64\bin\apache\apache2.4.27\conf
Enable php_openssl.dll in php.ini.
In wamp there are two php.ini files and You need to do this in both of them.
First one can be located inside of your WAMP taskbar icon
and the other one is located in C:\wamp64\bin\php\php(Version)
find the location for both of the php.ini files and find the line curl.cainfo = and give it a path like this
curl.cainfo = "C:\wamp64\bin\php\php7.1.9\extras\ssl\cacert.pem"
Now save the files and restart your server
In my case this error also happened when using Laravel's development server.
In order to fix it, just shifted stopped that server and ran Apache through XAMPP and that was enough to solve the problem.
If you're having troubles with this approach, please read the answers to this question for more details.

Apache httpd got 403 forbidden on MacOS High Sierra

I tried to install Apache HTTPD via Homebrew with brew install apache2, it worked well with default configuration http://localhost:8080
However, once I added more virtual host, to another folder (actually just clone the www folder to new one), and then tried to access to that new virtual host, I got 403 Forbidden error.
I don't think there was any wrong configuration, because it worked well with Apache2 on Ubuntu, but don't know why it's broken on MacOS, even I changed permission to 777 for that new www folder
Thanks
I hit the same wall, so I'd like to share my experience and hope it can help.
First of all, look at the error message in the log file that you specified for your virtual host.
If you see something like:
[authz_core:error] [pid 57233] [client 127.0.0.1:55693] AH01630: client denied by server configuration: /opt/local/www/your_vhost/
which indicates the module authz_core cause the forbidden. In this case, add Require all granted in your VirtualHost block can solve the problem.
There are different modules can cause the same problem, so you'd better to see the message in the log first.
The Apache2 error log helped me solved the mystery. It turned out that 127.0.0.1 is pointed to a VH with folder location in where there is no index.html. I thought it was pointing to my Docroot as in the case of the localhost.

BASH: Get HTTP link of file

Is there a way to get a HTTP link of a file from a script?
For example:
I have a file at:
/home/User/video.mp4
Next, I would like to get the http link of that file. For example:
http://192.168.1.5/video.mp4
I currently have nginx installed onto the remote server with a specific directory as the root of the web server.
On the server I have, you can get the server link using this:
echo "http://$(whoami).$(hostname -f)/path/to/file"
I could get the file link using the command above but this would be an issue with files with spaces in them.
I'm doing this so that I can send the link to Internet Download Manager under windows. So using wget to download files will not work for me.
I'm currently using cygwin to create the script.
To solve the spaces problem, you can replace them with %20:
path="http://$(whoami).$(hostname -f)/path/to/file"
path=${path// /%20}
echo $path
Regards.

501 error while on https and wamp server

I added SSL to my WAMP server on local host. Everything is working fine when I request for http url but when I ask https url it returns me 501 Not implemented error message for all external included files ie. images/js/css files.
Any remedies.
I am using WAMP Server 2.4 latest version from website. and did SSL settings as per the URL http://forum.wampserver.com/read.php?2,32986 ssl working but resources would load as mentioned above.
I found the issue and fixed it.
For those who stuck with same issue.
One more major issue with Wamp 2.4 is that Resources ie. .css, .js and image files don't load even after all configuration. To solve the issue kindly do the following:
download and install 1.0.1e openssl from http://slproweb.com/products/Win32OpenSSL.html
then find the files in the installed directory:
bin\openssl.cfg (replace with confg\openssl.cnf after renaming the .cfg file to .cnf)
bin\libeay32.dll
bin\ssleay32.dll
bin\openssl.exe
Stop the server and replace those files and enjoy!

Resources