aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/nginx.rb33
1 files changed, 21 insertions, 12 deletions
diff --git a/Library/Formula/nginx.rb b/Library/Formula/nginx.rb
index ce4dcc77f..28e0e20e5 100644
--- a/Library/Formula/nginx.rb
+++ b/Library/Formula/nginx.rb
@@ -45,6 +45,7 @@ class Nginx < Formula
"--with-http_ssl_module",
"--with-pcre",
"--with-ipv6",
+ "--sbin-path=#{bin}/nginx",
"--with-cc-opt=-I#{HOMEBREW_PREFIX}/include",
"--with-ld-opt=-L#{HOMEBREW_PREFIX}/lib",
"--conf-path=#{etc}/nginx/nginx.conf",
@@ -54,7 +55,9 @@ class Nginx < Formula
"--http-proxy-temp-path=#{var}/run/nginx/proxy_temp",
"--http-fastcgi-temp-path=#{var}/run/nginx/fastcgi_temp",
"--http-uwsgi-temp-path=#{var}/run/nginx/uwsgi_temp",
- "--http-scgi-temp-path=#{var}/run/nginx/scgi_temp"]
+ "--http-scgi-temp-path=#{var}/run/nginx/scgi_temp",
+ "--http-log-path=#{var}/log/nginx"
+ ]
args << passenger_config_args if build.include? 'with-passenger'
args << "--with-http_dav_module" if build.include? 'with-webdav'
@@ -69,23 +72,29 @@ class Nginx < Formula
system "make install"
man8.install "objs/nginx.8"
(var/'run/nginx').mkpath
+
+ prefix.cd do
+ dst = HOMEBREW_PREFIX/"var/www"
+ if not dst.exist?
+ mv "html", dst
+ dst.dirname.mkdir_p
+ else
+ rm_rf "html"
+ dst.mkpath
+ end
+ Pathname.new("#{prefix}/html").make_relative_symlink(dst)
+ end
end
def caveats; <<-EOS.undent
- In the interest of allowing you to run `nginx` without `sudo`, the default
- port is set to localhost:8080.
+ Docroot is: #{HOMEBREW_PREFIX}/var/www
- If you want to host pages on your local machine to the public, you should
- change that to localhost:80, and run `sudo nginx`. You'll need to turn off
- any other web servers running port 80, of course.
+ The default port has been set to 8080 so that nginx can run without sudo.
- You can start nginx automatically on login running as your user with:
- mkdir -p ~/Library/LaunchAgents
- cp #{plist_path} ~/Library/LaunchAgents/
- launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
+ If you want to host pages on your local machine to the wider network you
+ can change the port to 80 in: #{HOMEBREW_PREFIX}/etc/nginx/nginx.conf
- Though note that if running as your user, the launch agent will fail if you
- try to use a port below 1024 (such as http's default of 80.)
+ You will then need to run nginx as root: `sudo nginx`.
EOS
end