In this paper, we propose a flexible mixed-integer linear programming formulation of the AC OPF problem for distribution systems, using convexification and linearization techniques. The proposed formulation allows the representation of discrete decisions via integer decision variables, captures the nonlinear behavior of the electrical network via approximations of controllable accuracy, and can be solved to global optimality with commercial optimization solvers. The formulation is based on conventional variables that describe network behavior, which ensures its flexibility and the possibility of application to various distribution system problems, as we indicate with case studies.