Sunday, March 11, 2018

active directory - How to keep existing Exchange in new Domain

I have to migrate an entire domain xyz.local to zxy.com. We will setup new AD Controllers and migrate all users with the microsoft ADMT.
Is there a way to keep the existing Exchange Server with the mailboxes and to join it to the new domain?

domain name system - Active Directory: is it good to have 127.0.0.1 as DNS server entry on 2 machines that are 2 DNS servers in a local net?



This is a small local net with 10 computers in an office, they are running ms server 2003 active directory with 2 domain controllers. Each of the 2 DCs is also a DNS server and they syncronize. There are no more than these 2 DCs and 8 client machines in the whole domain.



In the config of the only network card of each computer it is like this:



The 8 client machines have an entry of DC1 as 1st and DC2 as 2nd DNS server. DC1 and DC2 both have 127.0.0.1 as DNS server entry.



Is there anything bad about this entry 127.0.0.1? I thought this is simple and clean and microsoft standard? Would it be better to put the own lan address (192.168.0.11 on DC1 and 192.168.0.12 on DC2) and not the loopback address there?




The DNS servers themselves (on DC1 and DC2) do their external lookups on the dsl-router.


Answer



I think that is perfectly fine.



It wouldn't be a good idea to put their LAN IP because if that ever changes, the DNS resolution may be broken. 127.0.0.1 will never change and will always point to the right ressource so you can just leave this as is.


centos - High apache load but zero traffic

I have a problem with new server.. I use VPS Centos with 1GB of ram and I use wordpress CMS.




The traffic <100 visitor/hour, but the apache have high load and make the server hang with zero free of ram and can't connect through ssh. I should reboot the vps to make it works



here is the load on Apache looks like



Tasks:  66 total,   1 running,  65 sleeping,   0 stopped,   0 zombie
Cpu(s): 1.6%us, 12.3%sy, 0.0%ni, 48.1%id, 23.0%wa, 4.8%hi, 10.2%si, 0.0%
Mem: 1018776k total, 116620k used, 902156k free, 1236k buffers
Swap: 1048568k total, 1013052k used, 35516k free, 26628k cached
2949 apache 20 0 459m 42m 3732 D 3.0 4.2 0:09.23 httpd

2959 apache 20 0 460m 29m 3744 D 2.0 3.0 0:02.72 httpd
2968 apache 20 0 460m 26m 3808 D 2.0 2.6 0:02.27 httpd
2972 apache 20 0 460m 24m 3784 D 2.0 2.5 0:02.44 httpd
2986 apache 20 0 460m 29m 3784 R 2.0 2.9 0:02.40 httpd
2969 apache 20 0 458m 29m 3864 D 1.6 3.0 0:02.63 httpd
2974 apache 20 0 460m 25m 3820 D 1.6 2.6 0:02.43 httpd
2990 apache 20 0 460m 23m 3920 D 1.6 2.4 0:02.36 httpd
2994 apache 20 0 460m 31m 3756 D 1.6 3.2 0:02.62 httpd
2956 apache 20 0 460m 26m 3740 D 1.3 2.7 0:02.73 httpd
2957 apache 20 0 465m 22m 3644 D 1.3 2.3 0:02.80 httpd

2967 apache 20 0 458m 24m 3764 D 1.3 2.5 0:02.60 httpd
2970 apache 20 0 463m 25m 3764 D 1.3 2.6 0:03.07 httpd
2971 apache 20 0 451m 22m 3792 D 1.3 2.3 0:02.47 httpd
2973 apache 20 0 458m 25m 3768 D 1.3 2.6 0:02.52 httpd
2987 apache 20 0 465m 20m 3772 D 1.3 2.1 0:03.02 httpd


But sometimes the server have uptime more than 5-10hrs but after that the problems start

Saturday, March 10, 2018

CWP: Setting up name servers and web panel at new server



I have installed CentOS Web Panel on my digital ocean droplet. I can access web panel using IP, and I have my domain example.com on name cheap.



I wanted to:





  1. Access web panel using srv.example.com


  2. And want to create ns1.example.com & ns2.example.com, so I can point sites on those records, which needs to be hosted on that server.




What I’m confused at:




  1. How should I point my site example.com to server? (By using A record or how)



  2. Should I point srv.example.com by adding A record on name cheap and create NS records there, and then point domain to those records?




What I’ve tried:



I tried to point example.com to server IP, and I was able to access web panel using domain, but it was accessible on main domain, and I tried to add hostname record as srv.example.com and it doesn’t work. Also, the ns records weren’t working.


Answer



Try these steps:





  1. create name records (ns1, and ns2) and point to your servers ip, (last option in Advanced DNS tab on namecheap)enter image description here


  2. Follow this guide to setup those records on server.


  3. Now add your primary domain as User Account on server


  4. Point primary domain to newly created records (ns1 and ns2)


  5. Now you can add dns record to point server.example.com to your servers ip.


  6. That's it!




PS: usually it don't take too much time to populate dns changes, but it can take upto 48 hours so please be patient and wait for results.


Apache Segmentation Fault

In my apache error log im getting lines such as




[Wed Sep 21 16:51:14 2011] [notice] child pid 5414 exit signal Segmentation fault (11), possible coredump in /tmp/apache-cores/
[Wed Sep 21 17:04:15 2011] [notice] child pid 5558 exit signal Segmentation fault (11), possible coredump in /tmp/apache-cores/
[Wed Sep 21 17:04:16 2011] [notice] child pid 5508 exit signal Segmentation fault (11), possible coredump in /tmp/apache-cores/
[Wed Sep 21 17:50:47 2011] [notice] child pid 5892 exit signal Segmentation fault (11), possible coredump in /tmp/apache-cores/
[Wed Sep 21 17:50:48 2011] [notice] child pid 5880 exit signal Segmentation fault (11), possible coredump in /tmp/apache-cores/
[Wed Sep 21 17:51:31 2011] [notice] child pid 5965 exit signal Segmentation fault (11), possible coredump in /tmp/apache-cores/

[Wed Sep 21 17:51:32 2011] [notice] child pid 5955 exit signal Segmentation fault (11), possible coredump in /tmp/apache-cores/


I've set CoreDumpDirectory and got this as a result using gdb, but I'm not sure what it means or where I can go from here .



Core was generated by `/usr/sbin/apache2 -k start'.
Program terminated with signal 11, Segmentation fault.
[New process 5955]
#0 0x000000000043f7e6 in ap_add_common_vars (r=0xa805a8)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/server/ util_script.c:242

242 /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/server /util_script.c: No such file or directory.
in /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/ser ver/util_script.c
(gdb) bt
#0 0x000000000043f7e6 in ap_add_common_vars (r=0xa805a8)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/server/util_script.c:242
#1 0x00007faac8643459 in php_handler (r=0xa99ae0)
at /tmp/buildd/php5-5.2.6.dfsg.1/sapi/apache2handler/sapi_apache2.c:586
#2 0x0000000000438f73 in ap_run_handler (r=0xa805a8)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/server/config.c:159
#3 0x000000000043c53f in ap_invoke_handler (r=0xa805a8)

at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/server/config.c:373
#4 0x0000000000449590 in ap_internal_redirect (new_uri=,
r=)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/modules/http/http_request.c:477
#5 0x00007faac7b6eb95 in handler_redirect (r=0xa9b2d8)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/modules/mappers/mod_rewrite.c:4829
#6 0x0000000000438f73 in ap_run_handler (r=0xa9b2d8)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/server/config.c:159
#7 0x000000000043c53f in ap_invoke_handler (r=0xa9b2d8)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/server/---Type to continue, or q to quit---

config.c:373
#8 0x000000000044972e in ap_process_request (r=0xa9b2d8)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/modules/http/http_request.c:258
#9 0x0000000000446858 in ap_process_http_connection (c=0xa795c8)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/modules/http/http_core.c:190
#10 0x0000000000440493 in ap_run_process_connection (c=0xa795c8)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/server/connection.c:43
#11 0x000000000044e3d0 in child_main (child_num_arg=)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/server/mpm/prefork/prefork.c:680
#12 0x000000000044e724 in make_child (s=0x676968, slot=11)

at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/server/mpm/prefork/prefork.c:777
#13 0x000000000044f366 in ap_mpm_run (_pconf=,
plog=, s=)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/server/mpm/prefork/prefork.c:912
#14 0x0000000000425be5 in main (argc=3, argv=0x7fff79e8fd68)
at /build/buildd-apache2_2.2.9-10+lenny11-amd64-vHbrzW/apache2-2.2.9/server/main.c:732

linux - Force Apache to display PHP errors instead of 500

I have a development server with Apache 2.2.8 /PHP 5.2.4 on Ubuntu Server 8.04. Sometimes my php code returns an Internal server 500 error instead of outputting the errors to the page.



The Apache error.log contains no entries regarding the 500 error and the access.log only contains the one line referencing that the 500 error occurred. In php.ini error_reporting = E_ALL and display_errors = On.



How do I get Apache or PHP to display the error on the page instead of a generic 500 error.

Thursday, March 8, 2018

email server - Making sure Postfix MDA and Dovecot IMAP understand mailbox location?



I want to setup Postfix and Dovecot with Postfix as the SMTP MTA (mail transfer agent) and the MDA (mail delivery agent) and Dovecot just as the IMAP server, but I want to make sure that they each understand the mailbox location, and I am not totally clear on this from the documentation.



If I use the following settings in the Postfix main.cf (username represents a system user that is setup to handle all virtual users):



virtual_mailbox_base=/home/username
virtual_mailbox_maps=hash:/etc/postfix/vmailbox



And in /etc/postfix/vmailbox (the / at the end of the mailbox path indicates a maildir mailbox):



info@example.com example.com/info/
sales@example.com example.com/sales/


So that the mailboxes would look like /home/username/example.com/info/ and so forth, as described in the documentation (http://www.postfix.org/VIRTUAL_README.html#virtual_mailbox).




And then use the following settings in the Dovecot dovecot.conf:



mail_home=/home/username/%d/%n
mail_location=maildir:~/Maildir


So that Dovecot has separate "home" and mailbox directories for the virtual users, as recommended in the documentation (http://wiki2.dovecot.org/VirtualUsers/Home), will this be a compatible setup?



Or, will Postfix be delivering mail to /home/username/example.com/info in cur, new, and tmp folders while Dovecot is looking for mail in /home/username/example.com/info/Maildir in cur, new, and tmp folders? Does the / to activate a maildir mailbox in the Postfix virtual_mailbox_maps indicate and automatically create a Maildir folder after example.com/info/ or will it create the difficulty I describe above?




Thank you.


Answer



For the above setup to work, the Dovecot dovecot.conf should contain:



mail_location=maildir:~


without the /Maildir


linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...