@AndrewZ990

Как сделать доступным redmine по прямой ссылке без порта, httpd?

Здравствуйте!
Подскажите, пожалуйста, как можно сделать перенаправление по умолчанию, чтобы в можно было обратиться к redmine без указания порта :3000.
Как сейчас: redmine.local:3000
Хочется: redmine.local
в httpd.conf поставил по-умолчанию слушать порт 3000. Но скорее всего неверно.
OS - Centos7, apache 2.2

Решено:
Для моего случая решением оказалось отрулить правила файрволом:
Для Centos7
#firewall-cmd --permanent --list-all
  вывод:
public (default)
  interfaces:
  sources:
  services: dhcpv6-client ssh
  ports: 5123/tcp 80/tcp
  masquerade: yes
  forward-ports: port=80:proto=tcp:toport=3000:toaddr=
  icmp-blocks:
  rich rules:
  • Вопрос задан
  • 938 просмотров
Пригласить эксперта
Ответы на вопрос 3
firedragon
@firedragon
Не джун-мидл-сеньор, а трус-балбес-бывалый.
вот рабочий код для nginx, в принципе в апаче есть подобное,
хотя как по мне запутано как то.
Как настроить apache для работы redmine по ip:port?

Самое главное настройте dns для redmine.local

cat red.vkorotenko.ru.conf
# Upstream Ruby process cluster for load balancing
upstream thin_cluster {
    server unix:/tmp/thin.0.sock;
}


server {
    listen       red.vkorotenko.ru:80;
    listen       red.vkorotenko.ru:443 ssl;
    server_name  red.vkorotenko.ru;
    # настройки для letsencrypt можно убрать
    include acme;
    # Redirect HTTP to HTTPS
    if ($scheme = http) {
        return 301 https://$server_name$request_uri;
    }


    access_log  /var/log/nginx/redmine_access.log;
    error_log   /var/log/nginx/redmine_error.log;

    ssl on;

    ssl_certificate /etc/letsencrypt/live/vkorotenko.ru/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/vkorotenko.ru/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/vkorotenko.ru/chain.pem;

    include proxy.include;
    proxy_redirect off;
    root /var/lib/redmine/default/public;

    # When we're back to non-sensitive things, send back to http
    # rewrite ^/$ https://red.vkorotenko.ru$request_uri permanent;

    # Examples of URLs we don't want to rewrite (otherwise 404 errors occur):
    # /projects/PROJECTNAME/archive?status=
    # /projects/copy/PROJECTNAME
    # /projects/PROJECTNAME/destroy

    # This should exclude those (tested here: http://www.regextester.com/ )
    if ($uri !~* "^/projects/.*(copy|destroy|archive)") {
        #rewrite ^/projects(.*) https://red.vkorotenko.ru$request_uri permanent;
    }

    #rewrite ^/guide(.*) https://red.vkorotenko.ru$request_uri permanent;
    #rewrite ^/users(.*) https://red.vkorotenko.ru$request_uri permanent;
    #rewrite ^/my/page(.*) https://red.vkorotenko.ru$request_uri permanent;
    #rewrite ^/logout(.*) https://red.vkorotenko.ru$request_uri permanent;

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }
    location / {
        try_files $uri/index.html $uri.html $uri @cluster;
    }
    location @cluster {
        proxy_pass http://thin_cluster;
    }

}
Ответ написан
Комментировать
CityCat4
@CityCat4
Внимание! Изменился адрес почты!
Наверное, виртхост создать :)

Listen *:3000

<VirtualHost 10.87.1.1:80>
    ServerName redmine.local
    ServerAdmin blabla@local
    
    CustomLog /var/log/httpd/redmine/access common
    ErrorLog /var/log/httpd/redmine/httpd
    
    DocumentRoot /var/www/vhosts/redmine/public/

    MaxRequestLen 20971520    
    RailsEnv production
    
    <Directory "/var/www/vhosts/redmine/public/">
            Options Indexes ExecCGI FollowSymLinks
            AllowOverride all

            Order deny,allow
            Deny from all
            
            Allow from 127.0.0.1
            Allow from 10.87.1.0/255.255.255.0
    </Directory>

</VirtualHost>


Кроме этого, еще понадобится passenger.conf с настройками модуля passenger для апача:
# Pathes from passenger-install-apache2-module
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.36/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
   PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.36
   PassengerDefaultRuby /usr/local/bin/ruby
</IfModule>

# Remove HTTP Headers
Header always unset "X-Powered-By"
Header always unset "X-Rack-Cache"
Header always unset "X-Content-Digest"
Header always unset "X-Runtime"

# Tuning of Passenger
PassengerMaxPoolSize 20
PassengerMaxInstancesPerApp 4
PassengerPoolIdleTime 3600
PassengerHighPerformance on
PassengerStatThrottleRate 10
PassengerMaxPreloaderIdleTime 0

PassengerLogLevel 0
PassengerDebugLogFile /var/www/log/passenger

RailsSpawnMethod smart
RailsAppSpawnerIdleTime 86400

# ServerName Host:Port
ServerName redmine.local:80
Ответ написан
Комментировать
@eoff
bundle exec rails server webrick -e production -p 80
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы