Perguntas idiotas Parte I
Sou totalmente leigo em linux e estou tendo que montar um servidor coisa q para um leigo como eu eh um desafio, ja apredi a instalar a distro e tb instalei um pacote rpm squid gracas a alguns HOWTO maravilhosos q qualquer leigo pode seguir, agora estou tendo algumas duvidas simples mas pára quem nao entende nadinha como eu e nao quer fazer beteira prefiro perguntar, eis a minha primeira pergunta:
1- Como eu edito um arquivo .conf?
Re: Perguntas idiotas Parte I
Citação:
Postado originalmente por AndresMarx
Sou totalmente leigo em linux e estou tendo que montar um servidor coisa q para um leigo como eu eh um desafio, ja apredi a instalar a distro e tb instalei um pacote rpm squid gracas a alguns HOWTO maravilhosos q qualquer leigo pode seguir, agora estou tendo algumas duvidas simples mas pára quem nao entende nadinha como eu e nao quer fazer beteira prefiro perguntar, eis a minha primeira pergunta:
1- Como eu edito um arquivo .conf?
Se você tiver em modo gráfico, abre um editor de texto kedit ou outro que tiver ai e modifica o arquivo e salva.
Se tiver em console digita vi /arquivo que você quer editar
exemplo: squid.conf em etc/squid/squid.conf
vc digita:
vi /etc/squid/squid.conf
Valeu.
Qualquer coisa manda ver.
:good:
Perguntas idiotas Parte I
Pergunta idiota Parte II:
Estou em console e ja fi as modificacoes agora como eu alvo e saio do edito?
Perguntas idiotas Parte I
Pergunta idiota Parte III:
Estou no vi denovo pois nao funcionou, como nunca editeitei nada no linux acho que fiz algo errado, tem varias linhas no squid.conf q contem os comandos que quero mas acho q o "#" que vem antes dos comandos acho q impede o funcionamento do mesmos, se for iso como eu procedo? tenho q retirar da linha os "#" para que eles funcionem? vou colocar abaixo um exemplo:
Citação:
# TAG: httpd_accel_single_host on|off
# If you are running Squid as a accelerator and have a single backend
# server then set this to on. This causes Squid to forward the request
# to this server irregardles of what any redirectors or Host headers
# says.
#
# Leave this at off if you have multiple backend servers, and use a
# redirector (or host table or private DNS) to map the requests to the
# appropriate backend servers. Note that the mapping needs to be a
# 1-1 mapping between requested and backend (from redirector) domain
# names or caching will fail, as cacing is performed using the
# URL returned from the redirector.
#
# See also redirect_rewrites_host_header.
#
#Default:
# httpd_accel_single_host off
Ele deveria ficar assim:
Citação:
# TAG: httpd_accel_single_host on|off
# If you are running Squid as a accelerator and have a single backend
# server then set this to on. This causes Squid to forward the request
# to this server irregardles of what any redirectors or Host headers
# says.
#
# Leave this at off if you have multiple backend servers, and use a
# redirector (or host table or private DNS) to map the requests to the
# appropriate backend servers. Note that the mapping needs to be a
# 1-1 mapping between requested and backend (from redirector) domain
# names or caching will fail, as cacing is performed using the
# URL returned from the redirector.
#
# See also redirect_rewrites_host_header.
#
#Default:
httpd_accel_single_host off
ou eu deveria colocar todo o comandos juntos no final do testo?
Citação:
# handled based on that assumption. This option defaults to
# the old Squid behavior, which is better for hit ratios but
# worse for clients using IE, if they need to be able to
# force fresh content.
#
#Default:
# ie_refresh off
http_port 3128
icp_port 3130
htcp_port 4827
cache_dir ufs /usr/local/squid/cache/ 100 16 256
Por favor quem souber me reponda rapido.
Perguntas idiotas Parte I
Citação:
Postado originalmente por AndresMarx
Pergunta idiota Parte III:
Estou no vi denovo pois nao funcionou, como nunca editeitei nada no linux acho que fiz algo errado, tem varias linhas no squid.conf q contem os comandos que quero mas acho q o "#" que vem antes dos comandos acho q impede o funcionamento do mesmos, se for iso como eu procedo? tenho q retirar da linha os "#" para que eles funcionem? vou colocar abaixo um exemplo:
# TAG: httpd_accel_single_host on|off
# If you are running Squid as a accelerator and have a single backend
# server then set this to on. This causes Squid to forward the request
# to this server irregardles of what any redirectors or Host headers
# says.
#
# Leave this at off if you have multiple backend servers, and use a
# redirector (or host table or private DNS) to map the requests to the
# appropriate backend servers. Note that the mapping needs to be a
# 1-1 mapping between requested and backend (from redirector) domain
# names or caching will fail, as cacing is performed using the
# URL returned from the redirector.
#
# See also redirect_rewrites_host_header.
#
#Default:
# httpd_accel_single_host off
Ele deveria ficar assim:
# TAG: httpd_accel_single_host on|off
# If you are running Squid as a accelerator and have a single backend
# server then set this to on. This causes Squid to forward the request
# to this server irregardles of what any redirectors or Host headers
# says.
#
# Leave this at off if you have multiple backend servers, and use a
# redirector (or host table or private DNS) to map the requests to the
# appropriate backend servers. Note that the mapping needs to be a
# 1-1 mapping between requested and backend (from redirector) domain
# names or caching will fail, as cacing is performed using the
# URL returned from the redirector.
#
# See also redirect_rewrites_host_header.
#
#Default:
httpd_accel_single_host off
ou eu deveria colocar todo o comandos juntos no final do testo?
Por favor quem souber me reponda rapido.
Vc tem que descomentar a linha para que ela funcione:
Exemplo: linha comentada não funciona
#httpd_accel_single_host off
Exemplo: linha descomentada funciona
httpd_accel_single_host off
:good:
Perguntas idiotas Parte I
Agora como eu alvo tudo e saio do editor?
Perguntas idiotas Parte I
apos fazer o q vc quer digite a tecla esc e digite :wq e da enter
Perguntas idiotas Parte I
vc pode usar o mcedit /etc/xxxx.conf ai so dar enter e editar o q quizer , depois tecle f2 para salvar e f10 para sair do arqvo, ok
T+
:good:
Perguntas idiotas Parte I
Kra, para vc poder edtiar algo pelo vi faça o seguinte:
por exemplo, o smb.conf, vc faz assim
vi /etc/samba/smb.conf
aí aparecerá a tela com as informaçoes do arquivo, para poder editar, vc terá q apertar a tecla INSERT, ao apertá-la vc poderá ver q no canto inferior direito estará escrito INSERT, significando q vc pode inserir e modificar dados. Após terminar suas alteraçoes vc fará o seguinte:
aperte esc e depois :wq
pq esse comando ??
pq quando vc digita :wq siginifica que vc está salavando e saindo do arquivo.
e se por ventura vc editar um monte de coisa no seu arquivo, mas nao quiser salvar nada faça:
aperte esc e depois :q!
fui claro ??
Perguntas idiotas Parte I
Perguntas idiotas Parte I
ou caso keira somente um preview do comando vc pode ler os manuais qdo t passarem um comando desconhecido por vc digite
#man comando
ai vc sabe o q faz a como faz ok? isso ajuda bastante. :good: :good:
Perguntas idiotas Parte I
Perguntas idiotas Parte I
Muito obrigado vcs foram de grande ajuda, se eu precisar de mais alguma coisa eu pergunto.