When i use my mac, i installed by brew. And it made all command usable every where
But, chocolatey does not allow windows to install NGINX.
So i downloaded under the C: and unzipped it.
Unlike Mac, i can't use NGINX or NGINX -s reload.
I think the 'bin' folder should be located in window 'PATH', but i could not know where it is.
When i order 'NGINX', cmd returns NGINX is not internal or external command.
How can i use these commands? Even though, Windows' directory tree is not similar with Mac's
If you download the nginx binary package from nginx website,when you unpacked it,there was no bin folder in it.The executable application is nginx.exe.The following is what looks like if you use ls command in the nginx directory.
C:\nginx-1.8.1>ls -1
conf
contrib
docs
html
logs
nginx.exe
temp
Related
I'm using a Linux Debian terminal, trying to install a Github .zip file by following a walkthrough (from Chromebook). They're using a Windows terminal and access the zip file from a G: drive. They run the following:
C:\Users\zasur>G:
G:\>cd filename.zip
G:\filename>npm install
Which installs the Github zip. I've looked all over online and tried a few different solutions but can't get past the second command they run.
I was able to open /mnt/chromeos/MyFiles/Downloads from Linux by sharing the Downloads folder with it.
I'm not sure how to change the directory from here to the filename.zip and/or run commands from it. Whenever I try to run cd filename.zip or cd /mnt/chromeos/MyFiles/Downloads/filename.zip it always fails. Is this even possible on a Chromebook?
I tried a lot of ways to do it, but no one helped.
I installed Jenkins with homebrew.
Run it by the command:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
I tried:
sudo defaults write /Library/Preferences/org.jenkins-ci httpPort 9999
But there is no file 'org.jenkins-ci'. So I created and tried again this command... Restart Jenkins... Didn't help!
I think the Jenkins installed by homebrew has its options in:
~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
so you would need to edit that and the relaunch. Note that, if you can't see your Library directory inside your Home directory in the Finder, you can type Cmd+Shift+G and type ~/Library.
I am using macbook and installed nginx using Homebrew from the terminal. I think i installed 2-3 versions of nginx in different locations. Now I can see my http://localhost:8080/ is working as it displays nginx home page in browser but how can I place my projects inside nginx? I tried to put those in one of the nginx directory but it does not work if if I try to go to project through browser.
Is there anything from where I can find the exact directory of this running version of nginx?
Use the brew list command:
$ brew list nginx
/usr/local/Cellar/nginx/1.10.1/bin/nginx
/usr/local/Cellar/nginx/1.10.1/homebrew.mxcl.nginx.plist
/usr/local/Cellar/nginx/1.10.1/html -> ../../../var/www
/usr/local/Cellar/nginx/1.10.1/share/man/man8/nginx.8
$ greadlink -f /usr/local/Cellar/nginx/1.10.1/html
/usr/local/var/www
Thus, the symlink links to /usr/local/var/www, and default configuration is likely to do likewise.
I'm running a MacPro G5 w/ 10.5.8. I ran:
sudo port selfupdate and then ran:
sudo port upgrade outdated
When it was all finished, I rebooted and apache2 was broken and would not serve PHP file any longer. If I replace the httpd.conf file, it will serve html files.
I finally gave up and restored the backup and the machine is running again. The problem is I have a second machine that I did the same thing on and don't want to go through the same process. I've read several posts about uninstalling/reinstalling Macports like this one from Kirk Roybal How to do a clean reinstall with macports?, but it doesn't say if this process will destroy or reset the contents of the /opt/local/ directory. Especially the MySQL DBs and htdocs contents. Does anyone know if this process is linked or destructive? I'll make backups of everything, of course, before trying anything.
SOLUTION:
I got it to work by making the php53 install work instead of going backwards. Here's what I did:
sudo port select --set php php53 (set MacPorts to use php53 instead of php5)
sudo port installed (Check to make sure php53-apache2handler is installed)
sudo port install php53-apache2handler (It wasn't and yours probably isn't either)
once that's done installing
php -v (check the version of PHP that's running)
cd /opt/local/apache2/modules
sudo /opt/local/apache2/bin/apxs -a -e -n php mod_php53.so (activates php within apache)
this should append
LoadModule php5_module modules/mod_php53.so
to your /opt/local/apache2/conf/httpd.conf file (check it now)
There will also be a line like this
LoadModule php5_module modules/mod_php5.so
Comment it out or remove it so is doesn't interfere with new install
It should also move a copy of mod_php53.so to
/opt/local/apache2/modules
If it's not there, see php53-apache2handler install above.
Check your httpd.conf file for errors
/opt/local/apache2/bin/httpd -S
Finally, create/edit php.ini file to tell apache2 how to connect to MySQL database
cd /opt/local/etc/php53
sudo cp php.ini-production php.ini (for production machine use development for dev machine)
sudo cp php.ini php.ini.bak
Add the default socket paths to php.ini
pdo_mysql.default_socket=/opt/local/var/run/mysql5/mysqld.sock (may vary based on MySQL version. Check the /opt/local/var/run directory if not sure)
mysql.default_socket=/opt/local/var/run/mysql5/mysqld.sock
mysqli.default_socket=/opt/local/var/run/mysql5/mysqld.sock
If you are having problems connecting to MySQL, check for typos in the above paths FIRST. Trust me it will save you tons of time!
If all went according to plan, you should be able to restart the machine, test to make sure all ports started automatically and things should be working.
The files that you add (eg: MySQL DBs) are not destroyed by an update. If you modify files that are managed by MacPorts (eg: they are listed in 'port contents '), then those modifications will be clobbered by an update.
Some projects install config files as examples and have the user make the real config file so as to not clobber it with an update. It looks like the apache2 port follows this pattern. It installs /opt/local/apache2/conf/original/httpd.conf and then copies it to the real location of /opt/local/apache2/conf/httpd.conf at activation time only if the file does not exist.
I'm trying to configure Apache to use relative paths in its httpd.conf file so that the server can be moved around without breaking anything.
I have changed ServerRoot to "../", but this causes some serious problems.
When I start Apache from the command line with httpd.exe, everything works fine, but if I try to install it and run it as a service, with httpd.exe -k install and net start Apache2.4, it gives a service-specific error code of 1 and will not start the service.
If I set ServerRoot to "./", the command httpd.exe will not work, (Apache cannot find its modules) but it can be installed and run as a service!
Is there a way to set Apache up with relative paths so that it can be run from the command line and as a service?
I am using Windows 7 Pro 64-bit and Apache 2.4.7 32-bit if that helps any.
Try to use ./../ as server root. Setting current directory ./ and then going one step back ../ as httpd.exe is located in bin directory. Of course the modules directory needs to be in the same directory as the bin directory.