LinuxForum.Fans
Тема

Ввожу 1 ирл попадаю в папку другого сайта

Автор: dikari08 16 сообщений 3729 просмотров
#369153

День добрый , у меня такая проблема , взял сервер на Дебиан 7 в хетзнере , установил Lamp , создал деректории в var/www c доменными именами сайта , всего их 4 штуки ( к примеру мой сайт1.ру , сайт 2.ру сайт 3.ру сайт4 .ру ), установил логирование и просмотр сайта в /etc/apache2/sites-available/my_sait скопировав перед этим default во все папки и настроив под свои сайты в хостс тоже прописал все сайты 127.0.0.1 my_sait.ru . Перевел домены на сервак прописав @ и www , проверил по пингу ping mysait.ru отзыв с ип сервером. Захожу в сайты по домену мой сайт3.ру а он меня перекидывает в сайт2.ру ( определил это скопировав разные файлы в каждую папку доменов )

#369186

Попробуйте убрать дефолтный файл виртхоста, и создать как тут описано простейший виртхост тыц для каждого сайта

#369193

httpd.conf в студию пожалуйста.

#369258
stranger написал:
httpd.conf в студию пожалуйста.

я вчера заново переустановил сервер , настроил все заново , счас открываю nano /etc/httpd/conf/httpd.conf а он пустой , его надо заполнять или просто есть другой файл настроек апаче ?

#369259

[console]locate httpd[/console]

#369262
stranger написал:
[console]locate httpd[/console]

[console]root@Debian # locate httpd
/etc/phpmyadmin/lighttpd.conf
/usr/lib/apache2/modules/httpd.exp
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-autoindex.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-dav.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-default.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-info.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-languages.conf.gz
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-manual.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-mpm.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-multilang-errordoc.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-ssl.conf.gz
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-userdir.conf
/usr/share/doc/apache2.2-common/examples/apache2/extra/httpd-vhosts.conf
[/console]

Потом пытаюсь перезапустить апаче2 , выдает это :

[console]root@Debian-70-wheezy-64-LAMP /etc/apache2/sites-enabled # service apache2 restart
[....] Restarting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 2a01:4f8:d12:5d1::2 for ServerName
[Wed Feb 26 16:47:19 2014] [warn] NameVirtualHost *:80 has no VirtualHosts
apache2: Could not reliably determine the server's fully qualified domain name, using 2a01:4f8:d12:5d1::2 for ServerName
[Wed Feb 26 16:47:19 2014] [warn] NameVirtualHost *:80 has no VirtualHosts
. ok
![/console]

#369303

dikari08, тьфу, старый я склеротик... Покажите (под катом ессно) /etc/apache2/apache2.conf

#369336
stranger написал:
dikari08, тьфу, старый я склеротик... Покажите (под катом ессно) /etc/apache2/apache2.conf

Я там не чего не менял , все осталось стандартно , но меня беспокит что /etc/httpd/conf/httpd.conf пустой , я заказывал сайт в сборке , его хезнер ставит на 5 минут , думаю может ставят не так

text
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives and /usr/share/doc/apache2-common/README.Debian.gz about
# Debian specific hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined # below, all located in the /etc/apache2/ directory: # # /etc/apache2/ # |-- apache2.conf # | `-- ports.conf # |-- mods-enabled # | |-- *.load # | `-- *.conf # |-- conf.d # | `-- * # `-- sites-enabled # `-- * # # # * apache2.conf is the main configuration file (this file). It puts the pieces # together by including all remaining configuration files when starting up the # web server. # # In order to avoid conflicts with backup files, the Include directive is # adapted to ignore files that: # |-- apache2.conf # | `-- ports.conf # |-- mods-enabled # | |-- *.load # | `-- *.conf # |-- conf.d # | `-- * # `-- sites-enabled # `-- * # # # * apache2.conf is the main configuration file (this file). It puts the pieces # together by including all remaining configuration files when starting up the # web server. # # In order to avoid conflicts with backup files, the Include directive is # adapted to ignore files that: # - do not begin with a letter or number # - contain a character that is neither letter nor number nor _-:. # - contain .dpkg # # Yet we strongly suggest that all configuration files either end with a # .conf or .load suffix in the file name. The next Debian release will # ignore files not ending with .conf (or .load for mods-enabled). # # * ports.conf is always included from the main configuration file. It is # supposed to determine listening ports for incoming connections, and which # of these ports are used for name based virtual hosts. # # * Configuration files in the mods-enabled/ and sites-enabled/ directories # contain particular configuration snippets which manage modules or virtual # host configurations, respectively. # # They are activated by symlinking available configuration files from their # respective *-available/ counterparts. These should be managed by using our # helpers a2enmod/a2dismod, a2ensite/a2dissite. See - contain .dpkg # # Yet we strongly suggest that all configuration files either end with a # .conf or .load suffix in the file name. The next Debian release will # ignore files not ending with .conf (or .load for mods-enabled). # # * ports.conf is always included from the main configuration file. It is # supposed to determine listening ports for incoming connections, and which # of these ports are used for name based virtual hosts. # # * Configuration files in the mods-enabled/ and sites-enabled/ directories # contain particular configuration snippets which manage modules or virtual # host configurations, respectively. # # They are activated by symlinking available configuration files from their # respective *-available/ counterparts. These should be managed by using our # helpers a2enmod/a2dismod, a2ensite/a2dissite. See # their respective man pages for detailed information. # # * Configuration files in the conf.d directory are either provided by other # packages or may be added by the local administrator. Local additions # should start with local- or end with .local.conf to avoid name clashes. All # files in conf.d are considered (excluding the exceptions noted above) by # the Apache 2 web server. # # * The binary is called apache2. Due to the use of environment variables, in # the default configuration, apache2 needs to be started/stopped with # /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not # work with the default configuration.

# Global configuration #

# # ServerRoot: The top of the directory tree under which the server's # * Configuration files in the conf.d directory are either provided by other # packages or may be added by the local administrator. Local additions # should start with local- or end with .local.conf to avoid name clashes. All # files in conf.d are considered (excluding the exceptions noted above) by # the Apache 2 web server. # # * The binary is called apache2. Due to the use of environment variables, in # the default configuration, apache2 needs to be started/stopped with # /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not # work with the default configuration.

# Global configuration #

# # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # NOTE! If you intend to place this on an NFS (or otherwise network) # mounted filesystem then please read the LockFile documentation (available # at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>); # you will save yourself a lot of trouble. # # Do NOT add a slash at the end of the directory path. # #ServerRoot "/etc/apache2"

# # The accept serialization lock file MUST BE STORED ON A LOCAL DISK. # LockFile ${APACHE_LOCK_DIR}/accept.lock

# # PidFile: The file in which the server should record its process # identification number when it starts. # NOTE! If you intend to place this on an NFS (or otherwise network) # mounted filesystem then please read the LockFile documentation (available # at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>); # you will save yourself a lot of trouble. # # Do NOT add a slash at the end of the directory path. # #ServerRoot "/etc/apache2"

# # The accept serialization lock file MUST BE STORED ON A LOCAL DISK. # LockFile ${APACHE_LOCK_DIR}/accept.lock

# # PidFile: The file in which the server should record its process # identification number when it starts. # This needs to be set in /etc/apache2/envvars # PidFile ${APACHE_PID_FILE}

# # Timeout: The number of seconds before receives and sends time out. # Timeout 300

# # KeepAlive: Whether or not to allow persistent connections (more than # one request per connection). Set to "Off" to deactivate. # KeepAlive On

# # MaxKeepAliveRequests: The maximum number of requests to allow # during a persistent connection. Set to 0 to allow an unlimited amount. # We recommend you leave this number high, for maximum performance. PidFile ${APACHE_PID_FILE}

# # Timeout: The number of seconds before receives and sends time out. # Timeout 300

# # KeepAlive: Whether or not to allow persistent connections (more than # one request per connection). Set to "Off" to deactivate. # KeepAlive On

# # MaxKeepAliveRequests: The maximum number of requests to allow # during a persistent connection. Set to 0 to allow an unlimited amount. # We recommend you leave this number high, for maximum performance. # MaxKeepAliveRequests 100

# # KeepAliveTimeout: Number of seconds to wait for the next request from the # same client on the same connection. # KeepAliveTimeout 5

## ## Server-Pool Size Regulation (MPM specific) ##

# prefork MPM # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spare # MaxClients: maximum number of server processes allowed to start # MaxRequestsPerChild: maximum number of requests a server process serves # # KeepAliveTimeout: Number of seconds to wait for the next request from the # same client on the same connection. # KeepAliveTimeout 5

## ## Server-Pool Size Regulation (MPM specific) ##

# prefork MPM # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spare # MaxClients: maximum number of server processes allowed to start # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 0 </IfModule>

# worker MPM # StartServers: initial number of server processes to start # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadLimit: ThreadsPerChild can be changed to this maximum value during a # graceful restart. ThreadLimit can only be changed by stopping # and starting Apache. # ThreadsPerChild: constant number of worker threads in each server process # MaxClients: maximum number of simultaneous client connections # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule mpm_worker_module> MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 0 </IfModule>

# worker MPM # StartServers: initial number of server processes to start # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadLimit: ThreadsPerChild can be changed to this maximum value during a # graceful restart. ThreadLimit can only be changed by stopping # and starting Apache. # ThreadsPerChild: constant number of worker threads in each server process # MaxClients: maximum number of simultaneous client connections # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule mpm_worker_module> StartServers 2 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 25 MaxClients 150 MaxRequestsPerChild 0 </IfModule>

# event MPM # StartServers: initial number of server processes to start # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxClients: maximum number of simultaneous client connections # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule mpm_event_module> StartServers 2 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 25 MaxClients 150 MaxRequestsPerChild 0 </IfModule>

# event MPM # StartServers: initial number of server processes to start # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxClients: maximum number of simultaneous client connections # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule mpm_event_module> StartServers 2 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 25 MaxClients 150 MaxRequestsPerChild 0 </IfModule>

# These need to be set in /etc/apache2/envvars User ${APACHE_RUN_USER} Group ${APACHE_RUN_GROUP}

# # AccessFileName: The name of the file to look for in each directory # for additional configuration directives. See also the AllowOverride # directive. #

AccessFileName .htaccess # viewed by Web clients. # <Files ~ "^\.ht"> Order allow,deny Deny from all Satisfy all </Files>

# # DefaultType is the default MIME type the server will use for a document # if it cannot otherwise determine one, such as from filename extensions. # If your server contains mostly text or HTML documents, "text/plain" is # a good value. If most of your content is binary, such as applications # or images, you may want to use "application/octet-stream" instead to # keep browsers from trying to display binary files as though they are # text. # # It is also possible to omit any default MIME type and let the # client's browser guess an appropriate action instead. Typically the # browser will decide based on the file's extension then. In cases # where no good assumption can be made, letting the default MIME type # unset is suggested instead of forcing the browser to accept # incorrect metadata. # DefaultType None

# # HostnameLookups: Log the names of clients or just their IP addresses # e.g., www.apache.org (on) or 204.62.129.132 (off). # The default is off because it'd be overall better for the net if people # had to knowingly turn this feature on, since enabling it means that # each client request will result in AT LEAST one lookup request to the # nameserver. # HostnameLookups Off

#369340

Я просто не совсем понимаю по идее определяет деректорию сайта файл /etc/apache2/sites-available/мой сайт и поставив в hosts 127.0.0.1 мой сайт , этих настроек вполне достаточно , но что то не хватает каких то настроек , подскажите как вы ставите сервера через ssh

#369377
dikari08 написал:
Я просто не совсем понимаю по идее определяет деректорию сайта файл /etc/apache2/sites-available/мой сайт и поставив в hosts 127.0.0.1 мой сайт , этих настроек вполне достаточно , но что то не хватает каких то настроек , подскажите как вы ставите сервера через ssh

так и просится ответ Руками :D но ладно шутки в сторону. Эх тряхну стариной когда то я веб сервак поднимал
1 -- /etc/apache2/sites-available/мой сайт <--- вот здесь хранятся virthost отключеный
/etc/apache2/sites-enable/мой сайт <--- вот здесь хранятся virthost подключеных (рабочих сайтов)

2 -- экстрасенсы в отпуске поэтому:

и поставив в hosts 127.0.0.1 мой сайт

это где на сервере с сайтом или на своей локальной машины с которой происходит подключение к серверу ?
ну и в догонку :
127.0.0.1 это вообще петля, он же localhost и работает только в приделах текущей физической машины. пруф тыц

Так что чтоб все в интернете могли обратится по доменному имени к "мой сайт" нужно поднимать DNS сервер, ну либо у регистратора доменного имени "Заказать сервер имен (NS)" ну к примеру вот этот дает такую возможность (халявно) при покупке у него доменного имени. Ну либо поискать бесплатный сервис с такой услугой.

#369425
lone_wolf написал:

1 -- /etc/apache2/sites-available/мой сайт <--- вот здесь хранятся virthost отключеный
/etc/apache2/sites-enable/мой сайт <--- вот здесь хранятся virthost подключеных (рабочих сайтов)

2 -- экстрасенсы в отпуске поэтому:

мне надо те же монипуляции проделать в sites-anable что и в папке sites-available и так размножить дефаюлт ?

и поставив в hosts 127.0.0.1 мой сайт
это где на сервере с сайтом или на своей локальной машины с которой происходит подключение к серверу ?
ну и в догонку :
127.0.0.1 это вообще петля, он же localhost и работает только в приделах текущей физической машины. пруф тыц

Так что чтоб все в интернете могли обратится по доменному имени к "мой сайт" нужно поднимать DNS сервер, ну либо у регистратора доменного имени "Заказать сервер имен (NS)" ну к примеру вот этот дает такую возможность (халявно) при покупке у него доменного имени. Ну либо поискать бесплатный сервис с такой услугой.

других серверов с днс у меня нет , с немцами говорить думаю бесполезно , т.к мой словарный запас немецкого заканчивается на фразе "гитлер капут" , я подумаю может что получиться .

Я вчера подумал , может найдуться добровольцы на этом сайте , сделать полную статью о настройке сайта на сервере со скриншотами и видео за вознаграждение . И ресурсу этому хорошо и мне нормально что можно поучиться с 0. Я готов помочь автору материало за детальность. Сервак уже есть, Нужен только человек который настроит и положит туда свой сайт и скажет "ура работает"

#369437
"dikari08" написал:
мне надо те же монипуляции проделать в sites-anable что и в папке sites-available и так размножить дефаюлт ?

эм не совсем я правильно сказал, я бы посоветовал виртхосты хранить в /etc/apache2/sites-available/ а в /etc/apache2/sites-enable/ делать симлинки из /etc/apache2/sites-available/, очень удобно когда надо сайт отключить просто линк удаляется и все.

для этого в Debian есть команда замечательная :
a2ensite site.com <--- включить сайт
a2dissite site.com <--- выключить сайт

"dikari08" написал:
Я вчера подумал , может найдуться добровольцы на этом сайте , сделать полную статью о настройке сайта на сервере со скриншотами за вознаграждение . и ресурсу хорошо и мне я посмотрю готов помочь автору материало за детальность. Сервак уже есть Нужен только человек который настроит и положит туда свой сайт и скажет "ура работает"

В инете есть статьи по поднятию веб сервера.

вот линк как пример

#369507

lone_wolf , я делаю сам и мне приходится все время читать чтоб что то сделать , серваком столкнулся в первый раз ( кроме на виртуалбокс )

Сделал вроде по инструкции и понял свои ошибки
1. я не делал cсылку на сайты в папку sites-enabled
2. стер в папке www файл index.html , и вывел деффюлтный файл ( a2dissite default ) и он по этому по ходу перессылал на имеющие сайты . Счас прочитал статью которую вы дали и переделал ввел дефаюлт и ввернул файл html указав на него в дефаюлте )

Счас нет проблемы этой с которой я пришел . СПС

Но появилась другая проблема баннер не отражается на сайте и подвала нет ( файлы все перенес корректно и 100% с сервака на сервак ) http://omsk.******.ru/ ( оригинальный сайт http://*******.com/ ) , вроде джаву установил на сервак , но чего то не хватает и не могу понять чего именно я не доустановил для корректной работы

#369509

ну то что я дал ссылку там самый простейший и самый минимальный конфиг виртхоста, я бы посоветовал в дальнейшем разобраться с защитными опциями виртхоста и применить их.

"dikari08" написал:
lone_wolf , я делаю сам и мне приходится все время читать чтоб что то сделать , серваком столкнулся в первый раз ( кроме на виртуалбокс )

в своё время я точно также шарнился в поиске спрашивал на форумах. Только меня зачастую отправляли в гугл :)

#369511
dikari08 написал:
файлы все перенес корректно и 100% с сервака на сервак

Что в одном коде 341 строка, а в другом 329 и на

text
<div id="testimonials">
                 <ul>

всё заканчивается даже без закрытия тела и документа не смущает?

#369513

Спасибо , счас проверю , не пойму вроде забрал файлы с сервака md5sum те же а как проникло изменение фиг знает

Войдите или зарегистрируйтесь, чтобы ответить.